• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ActionController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_post_action_creates_action

 public function test_post_action_creates_action()
 {
     $this->mySetup(__DIR__ . "/basic_action_table.xml");
     $new_data = ["name" => "derp", "description" => "pred"];
     $controller = new ActionController([], Response::REQUEST_METHOD_POST, $new_data);
     $response = $controller->getResponse();
     self::assertIsValidResponse($response, Response::STATUS_CODE_CREATED);
     self::assertIsCorrectResponseData($response->getBody(), $new_data);
 }
开发者ID:DEH-Standardization,项目名称:ehelse_server,代码行数:9,代码来源:ActionControllerTest.php


示例2: close_round

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function close_round()
 {
     //
     if (Session::has('admin')) {
         DB::table('rounds')->where('idgame', '=', Input::get('game'))->where('status', '=', 0)->update(array('status' => 1));
         $ActionController = new ActionController();
         $ActionController->order_actions();
         $ActionController->execute_actions();
         return Response::json(array('output' => 'closed'));
     } else {
         return Response::json(array('output' => 'not admin'));
     }
 }
开发者ID:lhkingkong,项目名称:kill-them-all-back,代码行数:18,代码来源:RoundController.php


示例3: dispatch

 /**
  * Framework entry point
  *
  * @return void.
  */
 public function dispatch()
 {
     include_once 'action/controller/http/HTTPResponse.php';
     include_once 'action/controller/http/HTTPRequest.php';
     $request = new HTTPRequest();
     $response = new HTTPResponse();
     try {
         $configurator = $this->manager->getConfigurator();
         Registry::put($configurator, '__configurator');
         Registry::put($logger = new Logger($configurator), '__logger');
         $ap = $configurator->getApplicationPath();
         // application path
         $an = $configurator->getApplicationName();
         // application name
         $logger->debug('[Medick] >> version: ' . Medick::getVersion() . ' ready for ' . $an);
         $logger->debug('[Medick] >> Application path ' . $ap);
         $routes_path = $ap . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . $an . '.routes.php';
         include_once $routes_path;
         // load routes
         $logger->debug('[Medick] >> Config File: ' . str_replace($ap, '${' . $an . '}', $configurator->getConfigFile()));
         $logger->debug('[Medick] >> Routes loaded from: ' . str_replace($ap, '${' . $an . '}', $routes_path));
         ActionControllerRouting::recognize($request)->process($request, $response)->dump();
     } catch (Exception $ex) {
         ActionController::process_with_exception($request, $response, $ex)->dump();
         $logger->warn($ex->getMessage());
     }
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:32,代码来源:Dispatcher.php


示例4: set_actions

function set_actions()
{
    $actions = array_filter(func_get_args());
    if (count($actions) === 1 && is_array($actions[0])) {
        $actions = $actions[0];
    }
    ActionController::$actions = array_merge(ActionController::$actions, $actions);
}
开发者ID:laiello,项目名称:my-imouto-booru,代码行数:8,代码来源:controller_callbacks.php


示例5: dispatch

 /**
 *  Dispatch a request from Apache
 *
 *  Called from file dispatch.php, which is invoked by
 *  {@link http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html Apache mod_rewrite}
 *  whenever a client makes a request.  Actions:
 *  <ol>
 *    <li>Remove forbidden tags and attributes from
 *      {@link http://www.php.net/reserved.variables#reserved.variables.get $_GET},
 *      {@link http://www.php.net/reserved.variables#reserved.variables.post $_POST} and
 *      {@link http://www.php.net/reserved.variables#reserved.variables.request $_REQUEST}.
 </li>
 *    <li>Start a session to keep track of state between requests from
 *      the client.</li>
 *    <li>Construct an ActionController to process the action.</li>
 *    <li>Process the route</li>
 *  </ol>
 *  @uses ActionController::__construct()
 *  @uses ActionController::process_route()
 *  @uses ActionController::process_with_exception()
 *  @uses InputFilter::process_all()
 *  @uses Session::start()
 */
 function dispatch()
 {
     if (TRAX_ENV != 'production') {
         $start = microtime(true);
     }
     try {
         InputFilter::process_all();
         Session::start();
         $ac = new ActionController();
         $ac->process_route();
     } catch (Exception $e) {
         ActionController::process_with_exception($e);
     }
     if (TRAX_ENV != 'production') {
         $duration = "(" . round((microtime(true) - $start) * 1000, 1) . "ms)";
         $url = parse_url($_SERVER['REQUEST_URI']);
         Trax::log("[1mRendered {$url['path']} {$duration}[0m");
     }
 }
开发者ID:phpontrax,项目名称:trax,代码行数:42,代码来源:dispatcher.php


示例6: redirect_to

 static function redirect_to($url, $url_params = array(), $redirect_params = array())
 {
     # Running after-filters!
     ActionController::run_after_filters();
     if ($redirect_params) {
         self::parse_parameters($redirect_params);
     }
     $route = url_for($url, $url_params);
     header("Location: {$route}");
     exit;
 }
开发者ID:laiello,项目名称:my-imouto-booru,代码行数:11,代码来源:action_view.php


示例7: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:7,代码来源:AboutController.php


示例8: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->opo_datamodel = Datamodel::load();
     $this->opo_app_plugin_manager = new ApplicationPluginManager();
     $this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:7,代码来源:BaseInterstitialController.php


示例9: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views'));
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/eastend/themes/" . $this->ops_theme . "/css/eastend.css", 'text/css');
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/eastend/conf/eastend.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('eastend plugin is not enabled'));
     }
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $this->opa_access_values = array();
     } else {
         $this->opa_access_values = caGetUserAccessValues($this->request);
     }
     $this->view->setVar('access_values', $va_access_values);
     $this->opo_result_context = new ResultContext($po_request, 'ca_objects', ResultContext::getLastFind($po_request, 'ca_objects'));
     JavascriptLoadManager::register('cycle');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:27,代码来源:ObjectSlideshowController.php


示例10: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/MetabolicChronology/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/MetabolicChronology/themes/' . $this->ops_theme . '/views'));
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/MetabolicChronology/conf/Chronology.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('Metabolic Chronology plugin is not enabled'));
     }
     $this->_initView($pa_options);
     $this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'MetabolicChronology');
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/MetabolicChronology/themes/" . $this->ops_theme . "/css/chronology.css", 'text/css');
     JavascriptLoadManager::register('jcarousel');
     JavascriptLoadManager::register('maps');
     $t_list = new ca_lists();
     $this->opn_silo_type_id = $t_list->getItemIDFromList('collection_types', 'silo');
     $this->opn_action_type_id = $t_list->getItemIDFromList('occurrence_types', 'action');
     $this->opn_context_type_id = $t_list->getItemIDFromList('occurrence_types', 'context');
     $this->opn_yes_list_id = $t_list->getItemIDFromList('yes_no', 'yes');
     $t_relationship_types = new ca_relationship_types();
     $this->opn_rel_type_action_display_image = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "display");
     $this->opn_rel_type_action_secondary_images = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "secondary");
     $va_access_values = caGetUserAccessValues($this->request);
     $this->opa_access_values = $va_access_values;
     $this->view->setVar('access_values', $va_access_values);
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:30,代码来源:ShowController.php


示例11: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // Reload user preferences config to reflect current user locale. Initial load of config file is prior to setting of preferred locale
     // (which requires loading of user preferences...) and does not reflect user's preferred language.
     $this->request->user->loadUserPrefDefs(true);
 }
开发者ID:kai-iak,项目名称:providence,代码行数:7,代码来源:PreferencesController.php


示例12: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/NovaMuse/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/NovaMuse/themes/' . $this->ops_theme . '/views'));
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/NovaMuse/conf/NovaMuse.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('NovaMuse plugin is not enabled'));
     }
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/NovaMuse/themes/" . $this->ops_theme . "/css/dashboard.css", 'text/css');
     $this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'dashboard');
     $t_list = new ca_lists();
     $this->opn_member_institution_id = $t_list->getItemIDFromList('entity_types', 'member_institution');
     $this->opn_individual_id = $t_list->getItemIDFromList('entity_types', 'ind');
     $this->opn_family_id = $t_list->getItemIDFromList('entity_types', 'fam');
     $this->opn_organization_id = $t_list->getItemIDFromList('entity_types', 'org');
     $t_object = new ca_objects();
     $this->opn_objectTableNum = $t_object->tableNum();
     $va_access_values = caGetUserAccessValues($this->request);
     $this->opa_access_values = $va_access_values;
     $this->view->setVar('access_values', $va_access_values);
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:26,代码来源:DashboardController.php


示例13: init

 public function init()
 {
     parent::init();
     $tabs = $this->getTabs();
     $type = $this->getType();
     if (in_array(ucfirst($type), $this->globalTypes)) {
         $ltype = strtolower($type);
         $tabs->add('overview', array('url' => 'director', 'label' => $this->translate('Overview')));
         foreach ($this->globalTypes as $tabType) {
             $ltabType = strtolower($tabType);
             $tabs->add($ltabType, array('label' => $this->translate(ucfirst($ltabType) . 's'), 'url' => sprintf('director/%ss', $ltabType)));
         }
         $tabs->activate($ltype);
         return;
     }
     $object = $this->dummyObject();
     if ($object->isGroup()) {
         $type = substr($type, 0, -5);
     }
     $tabs = $this->getTabs()->add('objects', array('url' => sprintf('director/%ss', strtolower($type)), 'label' => $this->translate(ucfirst($type) . 's')));
     if ($object->supportsGroups() || $object->isGroup()) {
         $tabs->add('objectgroups', array('url' => sprintf('director/%sgroups', $type), 'label' => $this->translate('Groups')));
     }
     $tabs->add('tree', array('url' => sprintf('director/%ss/templatetree', $type), 'label' => $this->translate('Tree')));
 }
开发者ID:helge000,项目名称:icingaweb2-module-director,代码行数:25,代码来源:ObjectsController.php


示例14: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if (!$this->request->isLoggedIn()) {
         $this->response->setRedirect($this->request->config->get('error_display_url') . '/n/2320?r=' . urlencode($this->request->getFullUrlPath()));
         return;
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:8,代码来源:ExportConfigurationController.php


示例15: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     //if (!$this->request->isLoggedIn() || !$this->request->user->canDoAction('can_do_search_reindex')) {
     //	$this->response->setRedirect($this->request->config->get('error_display_url').'/n/2320?r='.urlencode($this->request->getFullUrlPath()));
     //	return;
     //}
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:8,代码来源:ACLReindexController.php


示例16: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     caSetPageCSSClasses(array("staticPage"));
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:8,代码来源:DefaultController.php


示例17: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->opo_client_services_config = Configuration::load($this->request->config->get('client_services_config'));
     $this->view->setVar('client_services_config', $this->opo_client_services_config);
     JavascriptLoadManager::register("panel");
     JavascriptLoadManager::register('cycle');
     JavascriptLoadManager::register('bundleableEditor');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:9,代码来源:SetsController.php


示例18: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     JavascriptLoadManager::register('bundleListEditorUI');
     JavascriptLoadManager::register('panel');
     $this->opo_datamodel = Datamodel::load();
     $this->opo_app_plugin_manager = new ApplicationPluginManager();
     $this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:9,代码来源:BaseEditorController.php


示例19: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     $this->opa_access_values = caGetUserAccessValues($po_request);
     caSetPageCSSClasses(array("listing"));
 }
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:9,代码来源:ListingController.php


示例20: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->opo_library_services_config = caGetLibraryServicesConfiguration();
     if (!$this->request->isLoggedIn() || !$this->request->user->canDoAction('can_do_library_checkout') || !$this->request->config->get('enable_library_services') || !$this->request->config->get('enable_object_checkout')) {
         $this->response->setRedirect($this->request->config->get('error_display_url') . '/n/2320?r=' . urlencode($this->request->getFullUrlPath()));
         return;
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:9,代码来源:DashboardController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ActionMessage类代码示例发布时间:2022-05-23
下一篇:
PHP Action类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap