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


PHP ControllerFactory::getController方法代码示例

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


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

示例1: dispatch

 public function dispatch()
 {
     $helper = HelperFactory::getHelper("Http");
     $conf = $helper->parseGet($_GET);
     try {
         $staticRoute = $this->getCotrollerByAlias(ucfirst($conf["controller"]));
         if ($staticRoute !== false) {
             $conf["controller"] = $staticRoute['controller'];
             if ($staticRoute['action'] != '') {
                 $conf["action"] = $staticRoute['action'];
             }
         }
         $controller = ControllerFactory::getController(ucfirst($conf["controller"]));
         $controller->applyFilters($conf);
         $action = $conf["action"] . "Action";
         $controller->startUp($conf);
         call_user_func_array(array($controller, $action), $conf["param"]);
         $controller->render($conf["action"]);
     } catch (Doctrine_Connection_Exception $e) {
         exit($e->getMessage());
         ErrorHandler::displayError("Found a Doctrine connection error.<br>\n\t\t\t\t\t\t\t\t\t \tMake suere that you have started the Doctrine\n\t\t\t\t\t\t\t\t\t \tsubsystem.<br>");
     } catch (MissingControllerException $e) {
         exit("<h1>ERROR</h1><br><h2>Missing Controller</h2>");
     } catch (MissingClassException $e) {
         exit("<h1>ERROR</h1><br><h2>Missing class</h2>");
     } catch (Exception $e) {
         exit($e->getMessage());
         $controller = ControllerFactory::getController("_404");
         $controller->startUp();
         $controller->render("index");
     }
 }
开发者ID:p1r0,项目名称:MuffinPHP,代码行数:32,代码来源:DefaultDispatcher.php

示例2: execute

 /**
  * Perform execution of the application. This method is called from index2.php
  */
 function execute()
 {
     global $sugar_config;
     if (!empty($sugar_config['default_module'])) {
         $this->default_module = $sugar_config['default_module'];
     }
     $module = $this->default_module;
     if (!empty($_REQUEST['module'])) {
         $module = $_REQUEST['module'];
     }
     insert_charset_header();
     $this->setupPrint();
     $this->controller = ControllerFactory::getController($module);
     // if the entry point is defined to not need auth, then don't authenicate
     if (empty($_REQUEST['entryPoint']) || $this->controller->checkEntryPointRequiresAuth($_REQUEST['entryPoint'])) {
         $this->loadUser();
         $this->ACLFilter();
         $this->preProcess();
         $this->controller->preProcess();
     }
     if (ini_get('session.auto_start') !== false) {
         $_SESSION['breadCrumbs'] = new BreadCrumbStack($GLOBALS['current_user']->id);
     }
     SugarThemeRegistry::buildRegistry();
     $this->loadLanguages();
     $this->checkDatabaseVersion();
     $this->loadDisplaySettings();
     $this->loadLicense();
     $this->loadGlobals();
     $this->setupResourceManagement($module);
     $this->controller->execute();
     sugar_cleanup();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:36,代码来源:SugarApplication.php

示例3: execute

 /**
  * Perform execution of the application. This method is called from index2.php
  */
 function execute()
 {
     global $sugar_config;
     if (!empty($sugar_config['default_module'])) {
         $this->default_module = $sugar_config['default_module'];
     }
     $module = $this->default_module;
     if (!empty($_REQUEST['module'])) {
         $module = $_REQUEST['module'];
     }
     insert_charset_header();
     $this->setupPrint();
     $this->controller = ControllerFactory::getController($module);
     // If the entry point is defined to not need auth, then don't authenticate.
     if (empty($_REQUEST['entryPoint']) || $this->controller->checkEntryPointRequiresAuth($_REQUEST['entryPoint'])) {
         $this->loadUser();
         $this->ACLFilter();
         $this->preProcess();
         $this->controller->preProcess();
         $this->checkHTTPReferer();
     }
     SugarThemeRegistry::buildRegistry();
     $this->loadLanguages();
     $this->checkDatabaseVersion();
     $this->loadDisplaySettings();
     //$this->loadLicense();
     $this->loadGlobals();
     $this->setupResourceManagement($module);
     $this->controller->execute();
     sugar_cleanup();
 }
开发者ID:switcode,项目名称:SuiteCRM,代码行数:34,代码来源:SugarApplication.php

示例4: display

 function display()
 {
     global $mod_strings, $export_module, $current_language, $theme, $current_user;
     echo get_module_title("Activities", $mod_strings['LBL_MODULE_TITLE'], true);
     $mod_strings = return_module_language($current_language, 'Calls');
     // Overload the export module since the user got here by clicking the "Activities" tab
     $export_module = "Calls";
     $_REQUEST['module'] = 'Calls';
     $controller = ControllerFactory::getController('Calls');
     $controller->loadBean();
     $controller->preProcess();
     $controller->process();
     //Manipulate view directly to not display header, js and footer again
     $view = ViewFactory::loadView($controller->view, $controller->module, $controller->bean, $controller->view_object_map);
     $view->options['show_header'] = false;
     $view->options['show_title'] = false;
     $view->options['show_javascript'] = false;
     $view->process();
     die;
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:20,代码来源:view.list.php

示例5: testOpportunityNameValueFilled

 /**
  * @group bug39787
  */
 public function testOpportunityNameValueFilled()
 {
     $lead = SugarTestLeadUtilities::createLead();
     $lead->opportunity_name = 'SBizzle Dollar Store';
     $lead->save();
     $_REQUEST['module'] = 'Leads';
     $_REQUEST['action'] = 'ConvertLead';
     $_REQUEST['record'] = $lead->id;
     // Check that the opportunity name doesn't get populated when it's not in the Leads editview layout
     require_once 'include/MVC/Controller/ControllerFactory.php';
     require_once 'include/MVC/View/ViewFactory.php';
     $GLOBALS['app']->controller = ControllerFactory::getController($_REQUEST['module']);
     ob_start();
     $GLOBALS['app']->controller->execute();
     $output = ob_get_clean();
     $matches_one = array();
     $pattern = '/SBizzle Dollar Store/';
     preg_match($pattern, $output, $matches_one);
     $this->assertTrue(count($matches_one) == 0, "Opportunity name got carried over to the Convert Leads page when it shouldn't have.");
     // Add the opportunity_name to the Leads EditView
     SugarTestStudioUtilities::addFieldToLayout('Leads', 'editview', 'opportunity_name');
     // Check that the opportunity name now DOES get populated now that it's in the Leads editview layout
     ob_start();
     $GLOBALS['app']->controller = ControllerFactory::getController($_REQUEST['module']);
     $GLOBALS['app']->controller->execute();
     $output = ob_get_clean();
     $matches_two = array();
     $pattern = '/SBizzle Dollar Store/';
     preg_match($pattern, $output, $matches_two);
     $this->assertTrue(count($matches_two) > 0, "Opportunity name did not carry over to the Convert Leads page when it should have.");
     SugarTestStudioUtilities::removeAllCreatedFields();
     unset($GLOBALS['app']->controller);
     unset($_REQUEST['module']);
     unset($_REQUEST['action']);
     unset($_REQUEST['record']);
     SugarTestLeadUtilities::removeAllCreatedLeads();
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:40,代码来源:ConvertLeadTests.php

示例6: dirname

<?php

/*
* 2007-2011 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-2011 PrestaShop SA
*  @version  Release: $Revision: 6594 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
require dirname(__FILE__) . '/config/config.inc.php';
ControllerFactory::getController('ProductController')->run();
开发者ID:greench,项目名称:prestashop,代码行数:29,代码来源:product.php

示例7: define

<?php

/*
* 2012 TAS
*/
define('IN_TAS', true);
require dirname(__FILE__) . '/config/config.inc.php';
ControllerFactory::getController('RoomPlanSummaryController')->run();
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:8,代码来源:roomplan_summary.php

示例8: execute

 /**
  * Perform execution of the application. This method is called from index2.php
  */
 function execute()
 {
     global $sugar_config;
     if (!empty($sugar_config['default_module'])) {
         $this->default_module = $sugar_config['default_module'];
     }
     $module = $this->default_module;
     if (!empty($_REQUEST['module'])) {
         $module = $_REQUEST['module'];
     }
     insert_charset_header();
     $this->setupPrint();
     $this->controller = ControllerFactory::getController($module);
     // make sidecar view load faster
     // TODO the rest of the code will be removed as soon as we migrate all modules to sidecar
     if ($this->controller->action === 'sidecar' || $this->controller->action === 'index' && $this->controller->module === 'Home' && (empty($_REQUEST['entryPoint']) || isset($_REQUEST['action']) && $_REQUEST['action'] === 'DynamicAction') || empty($_REQUEST)) {
         // check for not authorised users
         $this->checkMobileRedirect();
         $this->controller->action = 'sidecar';
         $this->controller->execute();
         return;
     } elseif ($this->controller->action === 'Login' && $this->controller->module === 'Users') {
         // TODO remove this when we are "iFrame free"
         // by default login location is base site URL
         $location = rtrim($sugar_config['site_url'], '/') . '/';
         $loginRedirect = $this->getLoginRedirect();
         $loginVars = $this->getLoginVars();
         if (isset($loginVars['module'])) {
             if (isModuleBWC($loginVars['module'])) {
                 // in case if login module is BWC, location is the BWC URL (as if the user was already
                 // logged in), since authentication is managed by Sidecar, not the module itself
                 $location .= '#bwc/' . $loginRedirect;
             } else {
                 // otherwise compose basic Sidecar route
                 $location .= '#' . rawurlencode($loginVars['module']);
                 if (isset($loginVars['record'])) {
                     $location .= '/' . rawurlencode($loginVars['record']);
                 }
             }
         }
         echo '<script>
         if (parent.location == window.location) {
             window.location = ' . json_encode($location) . ';
         } else {
             window.top.SUGAR.App.bwc.login(' . json_encode($loginRedirect) . ');
         }
         </script>';
         return;
     }
     // If the entry point is defined to not need auth, then don't authenticate.
     if (empty($_REQUEST['entryPoint']) || $this->controller->checkEntryPointRequiresAuth($_REQUEST['entryPoint'])) {
         $this->startSession();
         // check for authorised users
         $this->checkMobileRedirect();
         $this->loadUser();
         $this->ACLFilter();
         $this->preProcess();
         $this->controller->preProcess();
         $this->checkHTTPReferer();
         $this->csrfAuthenticate();
     }
     SugarThemeRegistry::buildRegistry();
     $this->loadLanguages();
     $this->checkDatabaseVersion();
     $this->loadDisplaySettings();
     $this->loadLicense();
     $this->loadGlobals();
     $this->setupResourceManagement($module);
     $this->controller->execute();
     sugar_cleanup();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:74,代码来源:SugarApplication.php

示例9: dirname

<?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
*  @version  Release: $Revision: 14007 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
require_once dirname(__FILE__) . '/config/config.inc.php';
ControllerFactory::getController('BestSalesController')->run();
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:29,代码来源:best-sales.php

示例10: trim

         $ret['module'] = $_REQUEST['qc_module'];
         if (!isset($_REQUEST['iframe'])) {
             $out = trim($json->encode($ret, false));
         } else {
             $out = $ret['html'];
         }
         echo $out;
     }
     break;
 case 'saveQuickCreate':
     $GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: saveQuickCreate");
     require_once 'include/MVC/Controller/ControllerFactory.php';
     if (isset($_REQUEST['qcmodule'])) {
         $GLOBALS['log']->debug("********** QCmodule was set: {$_REQUEST['qcmodule']}");
     }
     $controller = ControllerFactory::getController($_REQUEST['qcmodule']);
     $controller->loadBean();
     $controller->pre_save();
     $GLOBALS['log']->debug("********** saving new {$controller->module}");
     $controller->action_save();
     //Relate the email to the new bean
     if (isset($_REQUEST['sugarEmail']) && $_REQUEST['sugarEmail'] == 'true' && isset($_REQUEST['uid']) && !empty($_REQUEST['uid'])) {
         $ie->email->retrieve($_REQUEST['uid']);
     } elseif (isset($_REQUEST['uid']) && !empty($_REQUEST['uid']) && isset($_REQUEST['ieId']) && !empty($_REQUEST['ieId'])) {
         $GLOBALS['log']->debug("********** Quick Create from non-imported message");
         $ie->retrieve($_REQUEST['ieId']);
         $ie->mailbox = $_REQUEST['mbox'];
         $ie->connectMailserver();
         $uid = $_REQUEST['uid'];
         if ($ie->protocol == 'imap') {
             $_REQUEST['uid'] = imap_msgno($ie->conn, $_REQUEST['uid']);
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:31,代码来源:EmailUIAjax.php

示例11: dirname

/*
* 2007-2011 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-2011 PrestaShop SA
*  @version  Release: $Revision: 9068 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
require dirname(__FILE__) . '/config/config.inc.php';
//ControllerFactory::getController('IndexController')->run();
$_GET['id_category'] = 1;
ControllerFactory::getController('CategoryController')->run();
开发者ID:ricardo-rdfs,项目名称:Portal-BIP,代码行数:29,代码来源:index.php

示例12: dirname

<?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
*  @version  Release: $Revision: 14007 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
require dirname(__FILE__) . '/config/config.inc.php';
ControllerFactory::getController('PricesDropController')->run();
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:29,代码来源:prices-drop.php

示例13: dirname

<?php

/**
 * @package   	OneAll Social Login
 * @copyright 	Copyright 2012 http://www.oneall.com - All rights reserved.
 * @license   	GNU/GPL 2 or later
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 */
require dirname(__FILE__) . '/config/config.inc.php';
require dirname(__FILE__) . '/controllers/OneAllSocialLoginController.php';
ControllerFactory::getController('OneAllSocialLoginController')->run();
开发者ID:avataros,项目名称:social-login-prestashop,代码行数:28,代码来源:oneallsociallogin.php

示例14: dirname

<?php

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';
require_once dirname(__FILE__) . '/classes/recaptchalib.php';
ControllerFactory::getController('FeedbackController')->run();
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:12,代码来源:feedback.php

示例15: dirname

<?php

require dirname(__FILE__) . '/config/config.inc.php';
ControllerFactory::getController('DesignEnquiryController')->run();
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:4,代码来源:designenquiries.php


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