Returns the main component
@return YiiWheels
495442
public function getYiiWheels()
    {
        if (self::$_wheels === null) {
            self::$_wheels = Yii::app()->getComponent('yiiwheels');
        }
        return self::$_wheels;
    }
152258
public function top()
    {
        $handles = array_keys((array)$this->_priority_list);

        $object = null;
        if (isset($handles[0])) {
            $object  = $this->_object_list[$handles[0]];
        }

        return $object;
    }
1178359
public function showComponentGroups()
    {
        $this->subMenu['groups']['active'] = true;

        return View::make('dashboard.components.groups.index')
            ->withPageTitle(trans_choice('dashboard.components.groups.groups', 2).' - '.trans('dashboard.dashboard'))
            ->withGroups(ComponentGroup::orderBy('order')->get())
            ->withSubMenu($this->subMenu);
    }
945571
public function run()
    {
        if (!Yii::$app->user->isGuest) {
            return $this->redirectTo(Yii::$app->getHomeUrl());
        }

        $model = Yii::createObject($this->modelClass);
        $load = $model->load(Yii::$app->request->post());

        if (Yii::$app->request->isAjax) {
            Yii::$app->response->format = Response::FORMAT_JSON;

            return ActiveForm::validate($model);
        }

        if ($load && $model->login()) {
            return $this->redirectTo(Yii::$app->getUser()->getReturnUrl());
        }

        return $this->controller->render($this->view, [
            'model' => $model,
        ]);
    }
556811
public function getView()
    {
        $module = \Yii::$app->controller->module;

        if (method_exists($module, 'getView')) {
            return $module->getView();
        }

        return parent::getView();
    }
315512
public function actionComponentCallEdit()
    {
        $className = \Yii::$app->request->get('componentClassName');

        return $this->render($this->action->id, [
            'component' => new $className(),
            'callable_id' => \Yii::$app->request->get('callable_id'),
        ]);
    }
215091
public function getComponent()
    {
        if (!isset($this->_component)) {
            $class = $this->componentClass;
            $class = strpos($class, '.') ? substr($class, 0, strpos($class, '.')) : $class;
            $component = new $class($this);
            $this->_component = $component;
        }
        return $this->_component;
    }
207061
public function run()
    {
        /** @var Module $module */
        $module = $this->controller->module;

        $model = new ExportForm([
            'format' => $module->defaultExportFormat,
        ]);

        if ($model->load(Yii::$app->request->post())) {
            $fileName = Yii::t('language', 'translations') . '.' . $model->format;

            Yii::$app->response->format = $model->format;

            Yii::$app->response->formatters = [
                Response::FORMAT_XML => [
                    'class' => XmlResponseFormatter::className(),
                    'rootTag' => 'translations',
                ],
                Response::FORMAT_JSON => [
                    'class' => JsonResponseFormatter::className(),
                ],
            ];

            Yii::$app->response->setDownloadHeaders($fileName);

            return $model->getExportData();
        } else {
            if (empty($model->languages)) {
                $model->exportLanguages = $model->getDefaultExportLanguages($module->defaultExportStatus);
            }

            return $this->controller->render('export', [
                'model' => $model,
            ]);
        }
    }
630772
public function getParent() {

		$pageClass = Yii::$app->cms->getPageClass( $this->type );

		return $this->hasOne( $pageClass, [ 'id' => 'parentId' ] );
	}
649974
protected function getRootComponent()
    {
        $cur = $this;
        while ($cur->parent !== null) {
            $cur = $cur->parent;
        }
        return $cur;
    }
1287627
public function run()
    {

        $model = $this->model;

        if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post()) && isset($_POST['ajax'])) {
            Yii::$app->response->format = Response::FORMAT_JSON;
            return \yii\widgets\ActiveForm::validate($model);
        }

        if ($model->load(Yii::$app->request->post())) {
            if ($model->save()) {

                if ($this->isSaveAndNew) {
                    Yii::$app->response->format = Response::FORMAT_JSON;
                    return [
                        'message' => 'saveAndNew',
                        'saveAndNewUrl' => $this->saveAndNewUrl,
                    ];
                }

                Yii::$app->getSession()->setFlash('success', $this->successMsg);
                Yii::$app->response->format = Response::FORMAT_JSON;
                return [
                    'message' => 'success',
                    'success' => true,
                ];
            }

            Yii::$app->getSession()->setFlash('error', $this->errorMsg);
            Yii::$app->response->format = Response::FORMAT_JSON;
            return [
                'message' => 'error',
                'success' => false,
                'error' => Json::encode($model->getErrors()),
            ];
        }

        return $this->controller->renderAjax($this->view, array_merge([
            'model' => $model,
        ], $this->params));
    }
1332455
public function getHandler()
    {
        $handlers = $this->handlers;
        if (isset($this->instructions['handler'])
            && isset($handlers[$this->instructions['handler']])) {
            return Yii::createObject([
                'class' => $handlers[$this->instructions['handler']],
                'bundle' => $this,
            ]);
        }

        return false;
    }
1326566
public function getActiveWindowObject()
    {
        if ($this->_activeWindowObject === null) {
            $activeWindow = $this->findActiveWindow($this->activeWindowHash);
            $object = Yii::createObject($activeWindow['objectConfig']);
            $object->setItemId($this->itemId);
            $object->setConfigHash($this->config->getHash());
            $object->setActiveWindowHash($this->activeWindowHash);
            Yii::$app->session->set($this->activeWindowHash, $this->itemId);
            $this->_activeWindowObject = $object;
        }
        
        return $this->_activeWindowObject;
    }
847004
public function run()
    {
        $hostInfo = Yii::$app->getRequest()->getHostInfo();
        $controller = $this->controller;
        if (($serviceUrl = $this->serviceUrl) === null) {
            $serviceUrl = $hostInfo . Url::toRoute([$this->getUniqueId(), $this->serviceVar => 1]);
        }
        if (($wsdlUrl = $this->wsdlUrl) === null) {
            $wsdlUrl = $hostInfo . Url::toRoute([$this->getUniqueId()]);
        }
        if (($provider = $this->provider) === null) {
            $provider = $controller;
        }
        $this->_service = $this->createWebService($provider, $wsdlUrl, $serviceUrl);

        if (is_array($this->classMap)) {
            $this->_service->classMap = $this->classMap;
        }
        foreach ($this->serviceOptions as $name => $value) {
            $this->_service->$name = $value;
        }
        if (isset($_GET[$this->serviceVar])) {
            $this->_service->run();
        } else {
            return $this->_service->renderWsdl();
        }
    }
47047
public function getMenuDataFromControllers()
    {
        \Yii::beginProfile('getMenuDataFromControllers: '.$this->controllerPrefix);

        $result = [];

        foreach ($this->getCommands() as $route) {
            if ($class = \Yii::$app->createController($route)) {
                $class = $class[0];
                if (method_exists($class, 'getBackendMenuData')) {
                    $result = ArrayHelper::merge($result, $class->getBackendMenuData());
                }
            }
        }

        \Yii::endProfile('getMenuDataFromControllers: '.$this->controllerPrefix);

        return $result;
    }
402816
public function actionIndex() {
        $transaction = null;
        $transactionPartsDebit = null;
        $transactionPartsCredit = null;

        $post = Yii::$app->request->post();

        if(key_exists('clone',$post)) {
            $transactionTemplate = Transaction::find()->withTransactionPartAndHash($post['clone'])->one();

            $transaction = StaticEb::initTransaction($transactionTemplate);
            $transactionPartsDebit = StaticEb::initTransactionPartsDebit($transactionTemplate->getTransactionPartsDebit());
            $transactionPartsCredit = StaticEb::initTransactionPartsCredit($transactionTemplate->getTransactionPartsCredit());

        } else {
            $transaction = StaticEb::initTransaction();
            $transactionPartsDebit = StaticEb::initTransactionPartsDebit();
            $transactionPartsCredit = StaticEb::initTransactionPartsCredit();
        }

        $accounts = ArrayHelper::map(Account::find()->all(),'account_id','name');

        return $this->render('enter', [
            'transaction' => $transaction,
            'tpDebit' => $transactionPartsDebit,
            'tpCredit' => $transactionPartsCredit,
            'accounts' => $accounts,
        ]);
    }
600786
public static function getImageComponent()
    {
        // Get image component
        if (is_object(static::$_imageComponent)) {
            $imageComponent = static::$_imageComponent;
        } else {
            $imageComponent = Yii::createObject([
                'class' => 'yii\image\ImageDriver',
            ]);
            // Store component for future using
            static::$_imageComponent = $imageComponent;
        }

        return $imageComponent;
    }