当前位置: 首页>>代码示例>>PHP>>正文


PHP Controller::getController方法代码示例

本文整理汇总了PHP中Controller::getController方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::getController方法的具体用法?PHP Controller::getController怎么用?PHP Controller::getController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controller的用法示例。


在下文中一共展示了Controller::getController方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show($cell, $params)
 {
     $setId = $cell->items[5048][0];
     $filters[5057] = "%COLUMN%=" . $setId;
     $forms = $this->model->getResourcesOpt(1617, $filters);
     foreach ($forms as $form) {
         echo 'FORM' . $setId;
         $formId = $form->items[5048][0];
         $resultDomain = $form->items[50190][0];
         $resultViewer = $form->items[50180][0];
         $resultContainer = $form->items[50181][0];
         $formAction = $form->items[5058][0];
         $nestedForm = $form->items[50198][0];
         $ret[1] = $ret[1] . $this->genarateJavaScript(5058, $formAction, $formId);
         $ret[1] = $ret[1] . $this->genarateJavaScript(5055, $resultDomain, $formId);
         $ret[1] = $ret[1] . $this->genarateJavaScript(50178, $resultViewer, $formId);
         $ret[1] = $ret[1] . $this->genarateJavaScript(50181, $resultContainer, $formId);
         $ret[1] = $ret[1] . $this->genarateJavaScript(50198, $nestedForm, $formId);
     }
     $contr = Controller::getController();
     $params[5055] = 163;
     $params[5095][50109] = '%COLUMN%=' . $setId;
     $params[50186][1] = " f1";
     // дополнительный класс
     $params[50186][2] = "find_input1";
     // id для текстового поля
     $params[50186][50185] = "1";
     $result = $contr->executeAction(2354, $params);
     $ret[0] = $ret[0] . $result[0];
     $ret[1] = $ret[1] . $result[1];
     //$result[0]='FiltersSetViewer';
     return $ret;
 }
开发者ID:AuroraService,项目名称:AuroraServiceCrm,代码行数:33,代码来源:filters_set.viewer.php

示例2: execute

 function execute()
 {
     try {
         $controller = \Controller::getController($this->controller, $this->action, $this->parameters);
         return $controller->run();
     } catch (\FileNotFoundException $e) {
         return new \NotFoundResponse();
     }
 }
开发者ID:nbshelton,项目名称:PWResource-OLD,代码行数:9,代码来源:routecommand.php

示例3: execute

 public function execute($params)
 {
     $model = Model::getModel();
     $paramSetId = $params[50109];
     $formCounter = $params[5065];
     //5065.Форма
     if (empty($formCounter)) {
         $formCounter = 1;
     }
     $actionId = $model->getResProperty($paramSetId, 5058);
     //5058.Действие
     $action = $model->getAction($actionId);
     $domain = $action->items[5055];
     $filters[50109] = '%COLUMN%=' . $paramSetId;
     //5058.Действие
     $orders[504] = 1;
     $actionFilters = $model->getResources(163, $filters, $orders);
     echo '<script language ="JavaScript">var data = {}; data["' . $formCounter . '"]={}; data["' . $formCounter . '"]["50109"] = ' . $paramSetId . '; data["' . $formCounter . '"]["5058"] = ' . $actionId . '; t={}; t["5079"]= ' . $_SESSION['id'] . '; t["50127"]="' . $_SESSION['hash'] . '";data["50126"]=t;data["' . $formCounter . '"]["5055"]=' . $domain . '; data["50129"]=' . $formCounter . '; data["5058"]=2316;</script>';
     if (!empty($actionFilters)) {
         echo '<div id="data_container_header">';
         echo ' <script language ="JavaScript">var filters = {}; data["' . $formCounter . '"]["5095"] = filters;</script>';
         foreach ($actionFilters as $aFilter) {
             echo $aFilter->items[501];
             $filters4[5048] = '%COLUMN% = 148';
             $contr = $model->getResources(14, $filters4);
             require_once substr($contr[0]->items[503], 5);
             //503.Местоположение
             $contr = new $contr[0]->items[501]();
             //501.Название
             $params2[5048] = $aFilter->items[5048];
             $params2[5082] = $aFilter->items[5082];
             $filters2[5048] = '%COLUMN%=' . $aFilter->items[5094];
             //5094.Значение по умолчанию
             if (!empty($aFilter->items[5094])) {
                 $defValue = $model->getResources(162, $filters2);
             }
             $filters3[$aFilter->items[5082]] = $defValue[0]->items[5096];
             //5096.SQL,5082.Идентификатор свойства
             $model->log("ExtShowController: ParamSetId=" . $paramSetId . ", PropId=" . $aFilter->items[5082] . ", DefaultValue=" . $aFilter->items[5094] . ", SQL=" . $defValue[0]->items[5096]);
             $params2[5094] = $aFilter->items[5094];
             $contr->execute($params2);
         }
         //echo '<a onclick="sendData(2316);">Применить</a>';
         echo '</div>';
     }
     $params[5095] = $filters3;
     $params[5058] = $actionId;
     $params[50149] = 1;
     $params[50147] = $filters3[50147];
     $mainController = Controller::getController();
     $ret = $mainController->executeAction($actionId, $params);
     return $ret;
 }
开发者ID:AuroraService,项目名称:AuroraServiceCrm,代码行数:53,代码来源:ext_show.controller.php

示例4: playerPartialExists

 protected function playerPartialExists($name)
 {
     if (array_key_exists($name, $this->playerPartialFlags)) {
         return $this->playerPartialFlags[$name];
     }
     $controller = Controller::getController();
     if (!$controller) {
         throw new Phpr_ApplicationException('Media tags can only be processed for front-end requests.');
     }
     $partial = Partial::loadCached($controller->getTheme(), $name);
     return $this->playerPartialFlags[$name] = !!$partial;
 }
开发者ID:rafasashi,项目名称:sd-laravel,代码行数:12,代码来源:MediaViewHelper.php

示例5: extractAnnotations

 /**
  * Returns an array of data where each data is an array with the following keys:
  *  - annotation
  *  - resource
  *
  * @param array  $routes array of Route-objects for which the annotations should be extracted
  * @param string $view
  *
  * @return array
  */
 public function extractAnnotations(array $routes, $view = 'default')
 {
     foreach ($routes as &$route) {
         if (!$route instanceof Route) {
             throw new \InvalidArgumentException(sprintf('All elements of $routes must be instances of Route. "%s" given', gettype($route)));
         }
         if (!$route->getDefault('_defaultHandler')) {
             $route = clone $route;
             $parameters = new ParameterBag($route->getDefaults());
             $route->setDefault('_controller', \Controller::getController($parameters)->getAction());
         }
     }
     return parent::extractAnnotations($routes);
 }
开发者ID:blast007,项目名称:bzion,代码行数:24,代码来源:Extractor.php

示例6: find

 public function find($params)
 {
     $model = Model::getModel();
     $domain = $params[5055];
     //5055.Домен
     echo $domain;
     $model->find($params[5091], $domain);
     //5091.Поисковый запрос
     $action = $model->getLeafAction(2316, $domain);
     $params2[5058] = $action->items[5048];
     //5058.Действие
     $params2[50125] = 1;
     //50125.Флаг поискового запроса
     $params2[5055] = $domain;
     //5055.Домен
     $mainContriller = Controller::getController();
     $mainContriller->executeAction(2316, $params2);
     //2316.Просмотр сущностей класса
 }
开发者ID:AuroraService,项目名称:AuroraServiceCrm,代码行数:19,代码来源:search.controller.php

示例7: showAction

 public function showAction()
 {
     $text = $this->container->getParameter('bzion.miscellaneous.maintenance');
     if (is_string($text)) {
         $defaultText = $text;
     } else {
         $defaultText = "Services are currently down for maintenance. Please try again later.";
     }
     if ($this->isJson()) {
         return new JsonResponse(array('success' => false, 'content' => $defaultText));
     }
     // Return plain text if we were using a controller that didn't return
     // HTML
     $attributes = $this->getRequest()->attributes;
     if ($attributes->has('_controller')) {
         if (\Controller::getController($attributes) instanceof \PlainTextController) {
             return $defaultText;
         }
     }
     return array('text' => $text);
 }
开发者ID:allejo,项目名称:bzion,代码行数:21,代码来源:MaintenanceController.php

示例8: display404Error

 /**
  * @deprecated as of 1.5 use Controller::getController('PageNotFoundController')->run();
  */
 public static function display404Error()
 {
     //		header('HTTP/1.1 404 Not Found');
     //		header('Status: 404 Not Found');
     //		include(dirname(__FILE__).'/../404.php');
     //		die;
     Controller::getController('PageNotFoundController')->run();
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:11,代码来源:Tools.php

示例9: define

<?php

/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
define('_PS_ADMIN_DIR_', getcwd());
require dirname(dirname(__FILE__)) . '/config/config.inc.php';
Controller::getController('GetFileController')->run();
开发者ID:jicheng17,项目名称:pengwine,代码行数:29,代码来源:get-file-admin.php

示例10: dispatch

 /**
  * Find the controller and instantiate it
  */
 public function dispatch()
 {
     $controller_class = '';
     // Get current controller
     $this->getController();
     if (!$this->controller) {
         $this->controller = $this->useDefaultController();
     }
     // Dispatch with right front controller
     switch ($this->front_controller) {
         // Dispatch front office controller
         case self::FC_FRONT:
             $controllers = Dispatcher::getControllers(array(_PS_FRONT_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_ . 'controllers/front/'));
             $controllers['index'] = 'IndexController';
             if (isset($controllers['auth'])) {
                 $controllers['authentication'] = $controllers['auth'];
             }
             if (isset($controllers['compare'])) {
                 $controllers['productscomparison'] = $controllers['compare'];
             }
             if (isset($controllers['contact'])) {
                 $controllers['contactform'] = $controllers['contact'];
             }
             if (!isset($controllers[strtolower($this->controller)])) {
                 $this->controller = $this->controller_not_found;
             }
             $controller_class = $controllers[strtolower($this->controller)];
             $params_hook_action_dispatcher = array('controller_type' => self::FC_FRONT, 'controller_class' => $controller_class, 'is_module' => 0);
             break;
             // Dispatch module controller for front office
         // Dispatch module controller for front office
         case self::FC_MODULE:
             $module_name = Validate::isModuleName(Tools::getValue('module')) ? Tools::getValue('module') : '';
             $module = Module::getInstanceByName($module_name);
             $controller_class = 'PageNotFoundController';
             if (Validate::isLoadedObject($module) && $module->active) {
                 $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_ . $module_name . '/controllers/front/');
                 if (isset($controllers[strtolower($this->controller)])) {
                     include_once _PS_MODULE_DIR_ . $module_name . '/controllers/front/' . $this->controller . '.php';
                     $controller_class = $module_name . $this->controller . 'ModuleFrontController';
                 }
             }
             $params_hook_action_dispatcher = array('controller_type' => self::FC_FRONT, 'controller_class' => $controller_class, 'is_module' => 1);
             break;
             // Dispatch back office controller + module back office controller
         // Dispatch back office controller + module back office controller
         case self::FC_ADMIN:
             if ($this->use_default_controller && !Tools::getValue('token') && Validate::isLoadedObject(Context::getContext()->employee) && Context::getContext()->employee->isLoggedBack()) {
                 Tools::redirectAdmin('index.php?controller=' . $this->controller . '&token=' . Tools::getAdminTokenLite($this->controller));
             }
             $tab = Tab::getInstanceFromClassName($this->controller, Configuration::get('PS_LANG_DEFAULT'));
             $retrocompatibility_admin_tab = null;
             if ($tab->module) {
                 if (file_exists(_PS_MODULE_DIR_ . $tab->module . '/' . $tab->class_name . '.php')) {
                     $retrocompatibility_admin_tab = _PS_MODULE_DIR_ . $tab->module . '/' . $tab->class_name . '.php';
                 } else {
                     $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_ . $tab->module . '/controllers/admin/');
                     if (!isset($controllers[strtolower($this->controller)])) {
                         $this->controller = $this->controller_not_found;
                         $controller_class = 'AdminNotFoundController';
                     } else {
                         // Controllers in modules can be named AdminXXX.php or AdminXXXController.php
                         include_once _PS_MODULE_DIR_ . $tab->module . '/controllers/admin/' . $controllers[strtolower($this->controller)] . '.php';
                         $controller_class = $controllers[strtolower($this->controller)] . (strpos($controllers[strtolower($this->controller)], 'Controller') ? '' : 'Controller');
                     }
                 }
                 $params_hook_action_dispatcher = array('controller_type' => self::FC_ADMIN, 'controller_class' => $controller_class, 'is_module' => 1);
             } else {
                 $controllers = Dispatcher::getControllers(array(_PS_ADMIN_DIR_ . '/tabs/', _PS_ADMIN_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_ . 'controllers/admin/'));
                 if (!isset($controllers[strtolower($this->controller)])) {
                     // If this is a parent tab, load the first child
                     if (Validate::isLoadedObject($tab) && $tab->id_parent == 0 && ($tabs = Tab::getTabs(Context::getContext()->language->id, $tab->id)) && isset($tabs[0])) {
                         Tools::redirectAdmin(Context::getContext()->link->getAdminLink($tabs[0]['class_name']));
                     }
                     $this->controller = $this->controller_not_found;
                 }
                 $controller_class = $controllers[strtolower($this->controller)];
                 $params_hook_action_dispatcher = array('controller_type' => self::FC_ADMIN, 'controller_class' => $controller_class, 'is_module' => 0);
                 if (file_exists(_PS_ADMIN_DIR_ . '/tabs/' . $controller_class . '.php')) {
                     $retrocompatibility_admin_tab = _PS_ADMIN_DIR_ . '/tabs/' . $controller_class . '.php';
                 }
             }
             // @retrocompatibility with admin/tabs/ old system
             if ($retrocompatibility_admin_tab) {
                 include_once $retrocompatibility_admin_tab;
                 include_once _PS_ADMIN_DIR_ . '/functions.php';
                 runAdminTab($this->controller, !empty($_REQUEST['ajaxMode']));
                 return;
             }
             break;
         default:
             throw new PrestaShopException('Bad front controller chosen');
     }
     // Instantiate controller
     try {
         // Loading controller
         $controller = Controller::getController($controller_class);
//.........这里部分代码省略.........
开发者ID:jpodracky,项目名称:dogs,代码行数:101,代码来源:Dispatcher.php

示例11: handleRaw

 private function handleRaw(Request $request, $type = self::MASTER_REQUEST, $catch = true)
 {
     $this->container->enterScope('request');
     $this->container->set('request', $request, 'request');
     $this->container->get('request_stack')->push($request);
     if ($type === self::MASTER_REQUEST) {
         $this->request = $request;
     }
     Service::setRequest($request);
     $event = new GetResponseEvent($this, $request, $type);
     $this->container->get('event_dispatcher')->dispatch(KernelEvents::REQUEST, $event);
     if ($request->attributes->get('_defaultHandler')) {
         return parent::handle($request, $type, $catch);
     }
     // An event may have given a response
     if ($event->hasResponse()) {
         return $this->filterResponse($event->getResponse(), $request, $type);
     }
     $session = $this->container->get('session');
     $session->start();
     Service::setFormFactory($this->container->get('form.factory'));
     $con = Controller::getController($request->attributes);
     $response = $con->callAction();
     return $this->filterResponse($response, $request, $type);
 }
开发者ID:blast007,项目名称:bzion,代码行数:25,代码来源:AppKernel.php

示例12: execute

 public function execute($iParams)
 {
     //echo 'AnalogBaseController';
     $controller = Controller::getController();
     $model = Model::getModel();
     $filters[5057] = "%COLUMN%=1525171";
     //
     $ret = $model->getResources(1017, $filters);
     // Список типов техники
     $filters[5057] = "%COLUMN%=1525170";
     //
     $ret2 = $model->getResources(1017, $filters);
     // Группы техники
     $filters[50178] = "%COLUMN%=1";
     //
     $ret3 = $model->getResources(1020, $filters);
     // Производители
     $filters[50178] = "%COLUMN%=0";
     //
     $ret4 = $model->getResources(1020, $filters);
     // Производители НЕ премиум
     $ret22 = $model->getResources(1027, null);
     //$params[5055]=163;
     //$params[5095][50109]='%COLUMN%=15214';
     $params[5055] = 1618;
     $params[5095][5048] = '%COLUMN%=15371';
     $params[50178] = 1218;
     $params[50186][1] = " f1";
     // дополнительный класс
     $params[50186][2] = "find_input1";
     // id для текстового поля
     //$params[50186][50185]="1";
     //$ret5 = $controller->executeAction(2354,$params);
     $ret5 = $controller->executeAction(2354, $params);
     echo '<script language="JavaScript">' . $ret5[1] . '</script>';
     //$params[50178]="";
     /*
             echo $ret5[1];
             $params[5055]=163;
             $params[5095][50109]='%COLUMN%=15214';
             $params[50186][1]=" f1"; // дополнительный класс
             $params[50186][2]="find_input1"; // id для текстового поля
             $params[50186][50185]="1";
             $ret5 = $controller->executeAction(2354,$params);
     */
     //$params[5055]=163;
     //$params[5095][50109]='%COLUMN%=15215';
     $params[5095][5048] = '%COLUMN%=15372';
     $params[50186][1] = " f2";
     // дополнительный класс
     $params[50186][2] = "find_input2";
     // id для текстового поля
     $params[50186][50185] = "2";
     $ret6 = $controller->executeAction(2354, $params);
     echo '<script language="JavaScript">' . $ret6[1] . '</script>';
     //$params[5055]=163;
     //$params[5095][50109]='%COLUMN%=15216';
     $params[5095][5048] = '%COLUMN%=15373';
     $params[50186][1] = " f3";
     // дополнительный класс
     $params[50186][2] = "find_input3";
     // id для текстового поля
     //$params[50186][50185]="3";
     $ret7 = $controller->executeAction(2354, $params);
     echo '<script language="JavaScript">' . $ret7[1] . '</script>';
     require_once 'templates/analog_base/analog_base.template.php';
 }
开发者ID:AuroraService,项目名称:AuroraServiceCrm,代码行数:67,代码来源:analog_base.controller.php

示例13: notFound

 /**
  * Shows the 404 page to the user.
  */
 protected function notFound()
 {
     if (_PS_VERSION_ < '1.5') {
         Tools::display404Error();
     } else {
         Controller::getController('PageNotFoundController')->run();
     }
 }
开发者ID:silbersaiten,项目名称:nostotagging,代码行数:11,代码来源:oauth2.php

示例14: header

* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 6844 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
/* Send the proper status code in HTTP headers */
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
if (in_array(substr($_SERVER['REQUEST_URI'], -3), array('png', 'jpg', 'gif'))) {
    require_once dirname(__FILE__) . '/config/settings.inc.php';
    header('Location: ' . __PS_BASE_URI__ . 'img/404.gif');
    exit;
} elseif (in_array(substr($_SERVER['REQUEST_URI'], -3), array('.js', 'css'))) {
    die('');
}
require_once dirname(__FILE__) . '/config/config.inc.php';
Controller::getController('PageNotFoundController')->run();
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:30,代码来源:404.php

示例15: json_decode

require_once 'core/model.php';
$model = Model::getModel();
$action = $_REQUEST['action'];
$domain = $_REQUEST['domain'];
$id = $_REQUEST['id'];
$json = json_decode($_POST['data'], true);
if ($action == "") {
    $action = $json[5058];
}
if (empty($action)) {
    $action = $json[$json[50129]][5058];
}
//$action = 2316;
//echo "Test";
require_once 'main.controller.php';
$mainController = Controller::getController();
//echo 'USER:'.$json[50126][5079];
//echo 'F:'.$json[1][5095][5048];
$mainController->loadPermissions($json[50126][5079]);
if ($action == 231 || $action == 232 || $action == 234) {
    $action = '2316';
}
file_put_contents("log", 'ActionId=' . $action . ', Form=' . $json[50129] . ', Entity=' . $json[50146]);
switch ($action) {
    case '2315':
        $params[5048] = $json[50128];
        //5048.Идентификатор
        $params[50130] = $json[50130];
        //50130.Счетчик форм
        $params[5058] = 2315;
        //5058.Действие, 2315.Просмотр сущности
开发者ID:AuroraService,项目名称:AuroraServiceCrm,代码行数:31,代码来源:interface.php


注:本文中的Controller::getController方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。