Prepare all actions of the controller
508856
function(controller, callback) {
            self.prepareControllerActions(controller, function(err, actions) {
                callback(err, controller, actions);
            });
        }
1142783
protected function actions() {
		// run parent actions ( keep 'admin_head' hook )
		parent::actions();

		if ( empty( $this->struct['page_title'] ) || empty( $this->struct['menu_title'] ) ) {
			return;
		}

		$this->setup_pages();

	}
961438
public function setAction(Controller $controller, $action = 'execute')
    {
        $this->controller = $controller;
        $this->action = $action;
    }
192331
def handle(self):
        """"""
        body = None
        req = self.request
        res = self.response
        rou = self.router
        con = None
        start = time.time()

        try:
            con = self.create_controller()
            con.call = self
            self.controller = con
            if not self.quiet:
                con.log_start(start)

            # the controller handle method will manipulate self.response, it first
            # tries to find a handle_HTTP_METHOD method, if it can't find that it
            # will default to the handle method (which is implemented on Controller).
            # method arguments are passed in so child classes can add decorators
            # just like the HTTP_METHOD that will actually handle the request
            controller_args, controller_kwargs = con.find_method_params()
            controller_method = getattr(con, "handle_{}".format(req.method), None)
            if not controller_method:
                controller_method = getattr(con, "handle")

            if not self.quiet:
                logger.debug("Using handle method: {}.{}".format(
                    con.__class__.__name__,
                    controller_method.__name__
                ))
            controller_method(*controller_args, **controller_kwargs)

        except Exception as e:
            self.handle_error(e) # this will manipulate self.response

        finally:
            if res.code == 204:
                res.headers.pop('Content-Type', None)
                res.body = None # just to be sure since body could've been ""

            if con:
                if not self.quiet:
                    con.log_stop(start)

        return res
572783
public function generateController()
    {
        if (!$this->confirm('Do you want to generate a controller?')) {
            return;
        }

        $this->console->call('generate:controller', [
            'name' => $this->getControllerName(),
            '--force' => $this->console->option('force'),
            '--scaffold' => true,
        ]);
    }
1124063
public function actionActivateAll()
    {
        if (isset($_POST['items'])) {
            foreach ($_POST['items'] as $id) {
                if ($model = $this->findModel($id)) {
                    $model->status = ActiveRecord::STATUS_ACTIVE;
                    $model->save(false);
                }
            }
        }
    }
901531
public function postLaunchAction()
    {
        $reflected = new \ReflectionClass($this->_controllerInstance);
        if ($reflected->hasMethod('postLaunchAction')) {
            call_user_func(array(
                $this->_controllerInstance,
                'postLaunchAction'
            ), null);
        }
    }
1272125
public function run()
    {
        // Creates the current controller instance
        $this->controller = new $this->controller($this->twig);

        // Calls the action method on the controller
        $response = call_user_func([$this->controller, $this->action]);

        // Shows the response
        echo $response;
    }
1208377
private function run_initializers()
    {
        $method_name = 'init';
        $cn = get_called_class();
        
        # Run ApplicationController's init method.
        if ($inits = $this->getAppControllersMethod($method_name)) {
            foreach ($inits as $init) {
                $init = $init->bindTo($this);
                $init();
            }
        }
        
        $method = $this->selfRefl->getMethod($method_name);
        if ($method->getDeclaringClass()->getName() == $cn) {
            $this->$method_name();
        }
    }
978615
def init_actions
      am = action_manager()
      am.add_action(Action.new("&Disable selection") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )
      am.add_action(Action.new("&Edit Toggle") { @edit_toggle = !@edit_toggle; $status_message.value = "Edit toggle is #{@edit_toggle}" })
    end
1187438
public function init()
    {
        add_action('admin_head', array($this, 'addJsVariables'));
        add_action('admin_enqueue_scripts', array($this, 'enqueue'));
        add_action('current_screen', function ($current_screen) {
            add_action('views_edit-' . $current_screen->post_type, array($this, 'addFilterUrlParams'));
        });
    }
222530
public function prepareController($controller)
    {
        $response   = $this->getResponse();

        if (!$response) {
            $response = new Response();
        }

        $controller->setView($this->getView())
            ->setResponse($response)
            ->setDependencyContainer($this->getDependencyContainer())
            ->setRequest($this->getRequest());
    }
587908
def SetAction(self, action, **kws):
        ""
        if hasattr(action,'__call__'):
            self.__action = Closure(action, **kws)
1305157
function(req, res, next) {
			req.controller = controllerName;
			req.action = actionName || 'index';
			next();
		}
958662
public function run()
    {
        try
        {
            $this['triggers']->callTrigger('before-match-request', $this);

            $this['request']->attributes->add(
                $this['router']->matchRequest($this['request'])
            );

            $this['triggers']->callTrigger('before-controller-resolver', $this);

            $this['response'] = $this->controllerResolver();
        }
        catch (ResourceNotFoundException $e)
        {
            $this['response'] = (new Controller($this))->serve404();
        }
        catch (\Exception $e)
        {
            $this['response'] = new Response();
            $this['response']->headers->set('Content-Type', 'text/plain');
            $this['response']->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
            $this['response']->setContent($e->getMessage());
        }

        if ($this['x-frame-options']) {
            $this['response']->headers->set('x-frame-options', $this['x-frame-options']);
        }

        $this['response']->prepare($this['request']);

        $this['triggers']->callTrigger('before-send-response', $this);

        $this['response']->send();
    }
1022884
protected function prepare()
    {
        //Force passice mode if not specified
        $this->addOption('passive', true);

        //To make call on different files, we must retrieve the root and apply commands to the path
        $tmp = clone $this->getUrl();
        $tmp->path('');
        $this->addOption('url', $tmp->toString());
    }
1210473
protected function prepareRequest(): void
    {
        // HTTP method
        $method = Request::getMethod();
        $this->method = strtoupper($method);

        // get path
        // %module% / %controller% / %id% / %relation% / %id%
        $path = Router::getCleanUri();

        $this->params = explode('/', rtrim($path, '/'));

        // module
        $this->module = array_shift($this->params);

        // controller
        $this->controller = array_shift($this->params);

        $data = Request::getParams();

        unset($data['_method'], $data['_module'], $data['_controller']);

        $this->data = array_merge($data, $this->data);

        $primary = $this->crud->getPrimaryKey();

        $this->primary = array_intersect_key($this->data, array_flip($primary));
    }