當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Template::before方法代碼示例

本文整理匯總了PHP中Template::before方法的典型用法代碼示例。如果您正苦於以下問題:PHP Template::before方法的具體用法?PHP Template::before怎麽用?PHP Template::before使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Template的用法示例。


在下文中一共展示了Template::before方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: before

 /**
  * The before() method is called before controller action
  */
 public function before()
 {
     parent::before();
     // Load the oauth2 config
     $this->config = Config::load('oauth2')->as_array();
     // create array of supported response types
     $this->responseTypes = array('code' => new Oauth2_ResponseType_AuthorizationCode($this->config), 'token' => new Oauth2_ResponseType_AccessToken($this->config));
     /**
      * Indicates if the user should be re-prompted for consent.
      * The default is auto, so a given user should only see the consent page for a given set of scopes 
      * the first time through the sequence. If the value is force, then the user sees a 
      * consent page even if they previously gave consent to your application for a given set of scopes.
      */
     $this->approval_prompt = $this->request->query('approval_prompt');
     // @todo not implemented so far these 4 vars
     $this->access_type = $this->request->query('access_type');
     /** email address or sub identifier
      * Passing this hint will either pre-fill the email box on the sign-in form or 
      * select the proper multi-login session, thereby simplifying the login flow.
      */
     $this->login_hint = $this->request->query('login_hint');
     //Optional. A market string that determines how the consent UI is localized.
     $this->locale = $this->request->query('locale');
     /** The display type to be used for the authorization page. 
      *	Valid values are "popup", "touch", "page", or "none".
      */
     $this->display = $this->request->query('display');
     // Disable sidebars on oauth2
     $this->_sidebars = FALSE;
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:33,代碼來源:authorize.php

示例2: before

 /**
  * The before() method is called before controller action
  */
 public function before()
 {
     parent::before();
     $this->auto_render = FALSE;
     // Load the oauth2 config
     $this->config = Config::load('oauth2')->as_array();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:10,代碼來源:revoke.php

示例3: before

 /**
  * The before() method is called before controller action
  *
  * @uses  ACL::required
  */
 public function before()
 {
     ACL::required('access comment');
     // Disable sidebars on comments page
     $this->_sidebars = FALSE;
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:12,代碼來源:comment.php

示例4: before

 /**
  * The before() method is called before controller action.
  */
 public function before()
 {
     // The action_index() is default
     if ($this->request->action() == 'index') {
         $this->request->action('welcome');
     }
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:11,代碼來源:welcome.php

示例5: before

 public function before()
 {
     // Internal request only!
     if ($this->request->is_initial()) {
         throw HTTP_Exception::factory(404, 'Access denied!', array(':type' => '<small>' . $this->request->uri() . '</small>'));
     }
     ACL::required('access content');
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:9,代碼來源:taxonomy.php

示例6: before

 /**
  * The before() method is called before controller action
  *
  * @uses  ACL::required
  * @uses  Theme::$is_admin
  */
 public function before()
 {
     // Inform tht we're in admin section for themers/developers
     Theme::$is_admin = TRUE;
     if ($this->request->action() != 'login') {
         ACL::redirect('administer site', 'admin/login');
     }
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:15,代碼來源:admin.php

示例7: before

 /**
  * The before() method is called before controller action
  *
  * @uses  Request::param
  * @uses  Request::action
  * @uses  ACL::required
  */
 public function before()
 {
     $id = $this->request->param('id', FALSE);
     if ($id and $this->request->action() == 'index') {
         $this->request->action('view');
     }
     if (!$id and $this->request->action() == 'index') {
         $this->request->action('list');
     }
     ACL::required('access content');
     parent::before();
 }
開發者ID:ultimateprogramer,項目名稱:cms,代碼行數:19,代碼來源:blog.php

示例8: before

 public function before()
 {
     parent::before();
     if ($this->_auth->logged_in() == false) {
         // No user is currently logged in
         $this->request->redirect('user/login');
     }
     if (Config::load('auth.enable_buddy', FALSE) == FALSE) {
         // If user buddy disabled, we return not ofund.
         throw HTTP_Exception::factory(404, __('Buddy not allowed'));
     }
     $this->user = $this->_auth->get_user();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:13,代碼來源:buddy.php

示例9: before

 /**
  * The before() method is called before controller action
  *
  * @uses  Assets::css
  * @uses  Auth::get_user
  * @uses  Request::uri
  * @uses  Request::action
  */
 public function before()
 {
     Assets::css('user', 'media/css/user.css', array('theme'), array('weight' => 60));
     parent::before();
     // Get the currently logged in user or set up a new one.
     // Note that get_user will also do an auto_login check.
     if (($this->_user = $this->_auth->get_user()) === FALSE) {
         $this->_user = ORM::factory('user');
     }
     if (strpos($this->request->uri(), 'user/reset/', 0) !== FALSE) {
         $this->request->action('reset_' . $this->request->action());
     }
     // Disable sidebars on user pages
     $this->_sidebars = FALSE;
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:23,代碼來源:user.php

示例10: before

 /**
  * The before() method is called before controller action
  *
  * @throws  HTTP_Exception
  *
  * @uses    Assets::css
  * @uses    User::is_guest
  */
 public function before()
 {
     if (User::is_guest()) {
         throw HTTP_Exception::factory(403, 'Permission denied! You must login!');
     }
     $id = $this->request->param('id', FALSE);
     if ($id and 'index' == $this->request->action()) {
         $this->request->action('view');
     }
     if (!$id and 'index' == $this->request->action()) {
         $this->request->action('inbox');
     }
     Assets::css('user', 'media/css/user.css', array('theme'), array('weight' => 60));
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:23,代碼來源:message.php

示例11: before

 /**
  * The before() method is called before controller action.
  *
  * @throws Http_Exception_404 If the provider is disabled
  *
  * @uses  Auth::logged_in
  * @uses  Route::get
  * @uses  Route::uri
  * @uses  Config::load
  * @uses  Session::get
  */
 public function before()
 {
     parent::before();
     // Disable sidebars on user pages
     $this->_sidebars = FALSE;
     // Load the session
     $this->session = Session::instance();
     // Set the provider controller
     $this->provider = strtolower($this->request->param('provider'));
     $providers = Auth::providers();
     // Throw exception if the provider is disabled
     if (!array_key_exists($this->provider, array_filter($providers))) {
         throw new Http_Exception_404('Unsupported provider', NULL);
     }
     $this->route = $this->request->route();
     // Load the client config
     $this->provider_config = Config::load("oauth2.providers.{$this->provider}");
     $this->client = OAuth2_Client::factory($this->provider, $this->provider_config['id'], $this->provider_config['secret']);
     if ($token = $this->session->get($this->key('access'))) {
         // Make the access token available
         $this->token = $token;
     }
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:34,代碼來源:provider.php

示例12: before

 /**
  * The before() method is called before controller action
  *
  * @uses    ACL::required
  */
 public function before()
 {
     ACL::required('access content');
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:10,代碼來源:tag.php

示例13: before

 /**
  * The before() method is called before controller action
  *
  * @uses  ACL::required
  */
 public function before()
 {
     ACL::required('sending mail');
     parent::before();
 }
開發者ID:MenZil-Team,項目名稱:cms,代碼行數:10,代碼來源:contact.php


注:本文中的Template::before方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。