yii\base\Controller ----
508420
public function actions() {

		if( !Yii::$app->user->isGuest ) {

			$this->layout = CoreGlobalWeb::LAYOUT_PRIVATE;
		}

		return [
			'captcha' => [
				'class' => 'yii\captcha\CaptchaAction',
				'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
			],
			'error' => [
				'class' => 'yii\web\ErrorAction'
			]
		];
	}
551239
private function createController(): void
    {
        $aFields  = $this->getArguments();
        $aCreated = [];

        try {

            $aClasses = array_filter(explode(',', $aFields['CLASS_NAME']));

            foreach ($aClasses as $sClass) {

                $aFields['CLASS_NAME'] = $sClass;
                $this->oOutput->write('Creating controller <comment>' . $sClass . '</comment>... ');

                //  Check for existing controller
                $sPath = static::CONTROLLER_PATH . $sClass . '.php';
                if (file_exists($sPath)) {
                    throw new ControllerExistsException(
                        'Controller "' . $sClass . '" exists already at path "' . $sPath . '"'
                    );
                }

                $this->createFile($sPath, $this->getResource('template/controller.php', $aFields));
                $aCreated[] = $sPath;
                $this->oOutput->writeln('<info>done!</info>');
            }

        } catch (\Exception $e) {
            $this->oOutput->writeln('<error>failed!</error>');
            //  Clean up created models
            if (!empty($aCreated)) {
                $this->oOutput->writeln('<error>Cleaning up - removing newly created controllers</error>');
                foreach ($aCreated as $sPath) {
                    @unlink($sPath);
                }
            }
            throw $e;
        }
    }
747752
public function getControllerClasses()
    {
        $moduleName = $this->getVarValue('moduleName', false);
    
        return (empty($moduleName) || !Yii::$app->hasModule($moduleName)) ? [] : Yii::$app->getModule($moduleName)->getControllerFiles();
    }
991785
public function makeController()
    {
        $this->options['name'] = ucfirst($this->ask('Controller Name (Example: MyController)'));

        // Resourceful Controller
        if ($this->confirm('Is this controller resourceful?')) {
            $this->options['-r'] = '--resource';
        }

        // Model Controller
        if ($this->confirm('Would you like to use route model binding?')) {
            $this->options['--model'] = $this->ask('Please enter the name of the model');
        }
    }
483728
protected function setup() {
        if (!$this->_isSetup) {
            $defaultConfig = array(
                'srcBasePath' => Yii::getAlias('@webroot'),
                'dstBasePath' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(true),
                'dstUrlBase' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(),
                'underOwnerEntityPath' => true,
                'createMode' => 0775,
                'cachingPath' => '',
            );
            $this->config = \yii\helpers\ArrayHelper::merge($defaultConfig, $this->config);


            $defaultOptions = array(
                'isTranslation' => false,
                'handleFiles' => true,
                'handleImages' => true,
            );
            $this->options = \yii\helpers\ArrayHelper::merge($defaultOptions, $this->options);
            $this->_isSetup = true;
        }
    }
1302328
public function index()
    {
        $userGroupPermission = $this->UserGroupPermission->newEntity();
        
        $controllers = $this->Acl->getControllers();
        $groups = $users = [];
        
        if( !empty($controllers['user']) ) {
            $Users = TableRegistry::get($controllers['user']);
            $users = $Users->find()->select(['id','email'])->toArray();
        }
        if( !empty($controllers['group']) ) {
            $groups = TableRegistry::get($controllers['group']);
            $groups = $groups->find()->select(['id','name'])->toArray();
        }

        $permission = $this->UserGroupPermission->Permission->find()->select(['id','unique_string'])
            ->order(['unique_string'=>'DESC'])->toArray();
        $this->set(compact('userGroupPermission', 'permission', 'users', 'groups'));
        $this->set('_serialize', ['userGroupPermission']);
    }
1184156
public function getControllerAndAction(){
		$path_info = Yii::$app->request->getPathInfo();
		$path_info = trim($path_info,"/");
		$controller_str = substr($path_info,strpos($path_info,"/")+1);
		$str = strrev($controller_str);
		$action = strrev(substr($str,0,strpos($str,"/")));
		$controllerstr = strrev(substr($str,strpos($str,"/")+1));
		$controllerstr = explode("/",$controllerstr);
		$arr = [];
		$count = count($controllerstr);
		$i = 0;
		foreach($controllerstr as $v){
			$i++;
			if($count == $i){
				$arr[] = ucfirst($v);
			}else{
				$arr[] = strtolower($v);
			}
		}
		return [
			'controller' => implode("/",$arr),
			'action'	=>  $action,
		];
	}
271145
function init(): void {
    $helpers = [
      'app' => \Yii::$app,
      'format' => new helpers\Format,
      'html' => new helpers\Html,
      'i18n' => new helpers\I18N,
      'url' => new helpers\Url
    ];

    $options = [
      'charset' => \Yii::$app->charset,
      'entity_flags' => ENT_QUOTES | ENT_SUBSTITUTE,
      'escape' => [Html::class, 'encode'],
      'helpers' => ArrayHelper::merge($helpers, $this->helpers),
      'partials_loader' => new Loader(['viewRenderer' => $this]),
      'strict_callables' => true
    ];

    if ($this->enableCaching) {
      /** @var \yii\caching\Cache $cache */
      $cache = Instance::ensure($this->cache, \yii\caching\Cache::class);
      $this->cache = $cache;
      $options['cache'] = new Cache(['viewRenderer' => $this]);
    }

    if ($this->enableLogging) $options['logger'] = new Logger;
    $this->engine = new \Mustache_Engine($options);

    parent::init();
    $this->helpers = [];
  }
1088486
private function generateController()
    {
        // Generate Controller class
        $controllerInstance = Controller::instance($this->columns, $this->viewType, $this);

        $controllerTemplateDir =
            dirname(dirname(__FILE__)).DS.'src'.DS.'Apps'.DS.'Controllers'.DS;

        $controllerInstance->setControllerTemplatePath($controllerTemplateDir);
        $controllerInstance->setApplicationDirectory($this->applicationDir);

        $controllerInstance->setControllerName($this->controller);
        $controllerInstance->setModelName($this->model);
        $controllerInstance->updateTemplate();
        $controllerInstance->generateControllerTemplate();

        $controllerInstance->generate();

        $this->info("Controller $this->controller Generated Successfully!");
    }
1126728
public function actionDel()
    {
        $ids = \Yii::$app->request->post('ids');
        foreach (StringHelper::explode($ids, ',', true, true) as $id) {
            $obj = DpAdminMenuUrl::find()
                ->findByUrlId($id)
                ->one();
            if ($obj) {
                $obj->status = DpAdminMenuUrl::STATUS_DELETE;
                $obj->save();
            }
        }

        return $this->renderSuccess('删除成功');
    }
457862
public function index() {
        $controllers = App::objects('Controller');
        $sitemap = array();

        // Fetch sitemap data
        foreach ($controllers as $controller) {
            App::uses($controller, 'Controller');

            // Don't load AppController's, SitemapController or Controller's who can't be found
            if (strpos($controller, 'AppController') !== false || $controller === 'SitemapController' || !App::load($controller)) {
                continue;
            }

            $instance = new $controller($this->request, $this->response);
            $instance->constructClasses();

            if (method_exists($instance, '_generateSitemap')) {
                if ($data = $instance->_generateSitemap()) {
                    $sitemap = array_merge($sitemap, $data);
                }
            }
        }

        // Cleanup sitemap
        if ($sitemap) {
            foreach ($sitemap as &$item) {
                if (is_array($item['loc'])) {
                    if (!isset($item['loc']['plugin'])) {
                        $item['loc']['plugin'] = false;
                    }

                    $item['loc'] = h(Router::url($item['loc'], true));
                }

                if (array_key_exists('lastmod', $item)) {
                    if (!$item['lastmod']) {
                        unset($item['lastmod']);
                    } else {
                        $item['lastmod'] = CakeTime::format(DateTime::W3C, $item['lastmod']);
                    }
                }
            }
        }

        // Disable direct linking
        if (empty($this->request->params['ext'])) {
            throw new NotFoundException();
        }

        // Render view and don't use specific view engines
        $this->RequestHandler->respondAs($this->request->params['ext']);

        $this->set('sitemap', $sitemap);
    }
67879
public function init()
	{
        Yii::app()->language = Cii::setApplicationLanguage();
        parent::init();
		if (isset(Yii::app()->theme) && isset(Yii::app()->theme->name))
			$this->basePath = Yii::getPathOfAlias('base.themes.' . Yii::app()->theme->name . '.messages');
        else if (isset(Yii::app()->controller->module->id))
            $this->basePath = Yii::getPathOfAlias('application.modules.' . Yii::app()->controller->module->id);
		else
			$this->basePath = Yii::getPathOfAlias('application.modules.install');
	}
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,
        ]);
    }
752220
public function hasController()
    {
        return $this->def->getService() !== null &&
            $this->def->getService()->getRouterBase() !== null;
    }
945649
public function get_controller_actions($controller_classname, $filter_base_methods = true)
	{
	    $controller_classname = $this->get_controller_classname($controller_classname);
	    
		$methods = get_class_methods($controller_classname);
		
		if(isset($methods) && !empty($methods))
		{
    		if($filter_base_methods)
    		{
    			$baseMethods = get_class_methods('Controller');
    		
    			$ctrl_cleaned_methods = array();
    		    foreach($methods as $method)
    		    {
    		        if(!in_array($method, $baseMethods) && strpos($method, '_') !== 0)
    				{
    				    $ctrl_cleaned_methods[] = $method;
    				}
    		    }
    		    
    		    return $ctrl_cleaned_methods;
    		}
    		else
    		{
    			return $methods;
    		}
		}
		else
		{
		    return array();
		}
	}
229749
public function run()
    {
        if ($this->hasModel()) {
            $input = Html::activeTextInput($this->model, $this->attribute, $this->options);
            $this->mobileField = Html::getInputId($this->model,$this->mobileField);
        } else {
            $input = Html::textInput($this->name, $this->value, $this->options);
            $this->mobileField = $this->name;
        }
        $button = Html::button(Yii::t('yuncms', 'Get Verify Code'), $this->buttonOptions);

        $this->registerClientScript();
        echo strtr($this->template, [
            '{input}' => $input,
            '{button}' => $button,
        ]);
    }
605933
private function invokeRoute(): void
    {
        $moduleName = $this->routeInfo->moduleName;
        $controllerName = $this->routeInfo->controllerName;
        $actionName = $this->routeInfo->actionName;
        $controllerClass = $this->config->getValue('CONTROLLER_NAMESPACE') . '\\' . str_replace('.', '\\', $moduleName) . '\\' . $controllerName;
        if (! class_exists($controllerClass)) {
            $event = RouteErrorEvent::createCustom(404, $moduleName . '/' . $controllerName . '/' . $actionName . '对应的控制器类' . $controllerClass . '不存在');
            $event->httpErrorCode = 404;
            $this->dispatchEvent($event);
            return;
        }
        // 执行操作
        $this->invokeAction(new $controllerClass(), $actionName);
    }