public function build()
    {
        // load filter
        // 1. App/Controller/filter.yml
        // 2. App/Controller/foo.filter.yml
        $filters = $this->controller->getFilters();
        for ($i = 0; $i < count($filters); $i++) {
            $this->loadFilter($filters[$i], $i !== count($filters) - 1);
        }

        // action filter is already last.
        if (! $this->has_action_filter) {
            $this->addFilter('Action');
        } else {
            $action = null;
            $names = array();
            foreach ($this->filter_names as $name) {
                if (strtolower($name) === 'action') {
                    $action = $name;
                } else {
                    $names[] = $name;
                }
            }
            $names[] = $action;
            $this->filter_names = $names;
        }
    }