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


PHP Theme::initialize方法代码示例

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


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

示例1: initialize

 /**
  * 
  * Initializes configs for the APP to run
  */
 public static function initialize()
 {
     /**
      * Load all the configs from DB
      */
     //Change the default cache system, based on your config /config/cache.php
     Cache::$default = Core::config('cache.default');
     //is not loaded yet in Kohana::$config
     Kohana::$config->attach(new ConfigDB(), FALSE);
     //overwrite default Kohana init configs.
     Kohana::$base_url = Core::config('general.base_url');
     //enables friendly url @todo from config
     Kohana::$index_file = FALSE;
     //cookie salt for the app
     Cookie::$salt = Core::config('auth.cookie_salt');
     /* if (empty(Cookie::$salt)) {
     			// @TODO missing cookie salt : add warning message
     		} */
     // -- i18n Configuration and initialization -----------------------------------------
     I18n::initialize(Core::config('i18n.locale'), Core::config('i18n.charset'));
     //Loading the OC Routes
     // if (($init_routes = Kohana::find_file('config','routes')))
     // 	require_once $init_routes[0];//returns array of files but we need only 1 file
     //faster loading
     require_once APPPATH . 'config/routes.php';
     //getting the selected theme, and loading options
     Theme::initialize();
 }
开发者ID:azorpax,项目名称:common,代码行数:32,代码来源:core.php

示例2: initialize

 /**
  * 
  * Initializes configs for the APP to run
  */
 public static function initialize()
 {
     //enables friendly url
     Kohana::$index_file = FALSE;
     //temporary cookie salt in case of exception
     Cookie::$salt = 'cookie_oc_temp';
     //Change the default cache system, based on your config /config/cache.php
     Cache::$default = Core::config('cache.default');
     //loading configs from table config
     //is not loaded yet in Kohana::$config
     Kohana::$config->attach(new ConfigDB(), FALSE);
     //overwrite default Kohana init configs.
     Kohana::$base_url = Core::config('general.base_url');
     //cookie salt for the app
     Cookie::$salt = Core::config('auth.cookie_salt');
     // i18n Configuration and initialization
     I18n::initialize(Core::config('i18n.locale'), Core::config('i18n.charset'));
     //Loading the OC Routes
     require_once APPPATH . 'config/routes.php';
     //getting the selected theme, and loading options
     Theme::initialize();
     //run crontab
     if (core::config('general.cron') == TRUE) {
         Cron::run();
     }
 }
开发者ID:ThomWensink,项目名称:common,代码行数:30,代码来源:core.php

示例3: doCommand

 public function doCommand()
 {
     $path = $this->param('path', '');
     $settings = $this->param('settings', NULL);
     $register = $this->param('register', NULL);
     if (is_null($settings)) {
         $settings = array();
     }
     // Since Context is an object, it will be a valid reference
     // to the context for the duration of the request. The only exception
     // would be if one (manually) switched requests without throwing an
     // interrupt.
     Theme::initialize($path, $settings, $this->context);
     if (!empty($register)) {
         foreach ($register as $klass) {
             Theme::register($klass);
         }
     }
     return TRUE;
 }
开发者ID:masterminds,项目名称:fortissimo,代码行数:20,代码来源:InitializeTheme.php

示例4: __construct

 /**
  *
  * Contruct that checks you are loged in before nothing else happens!
  */
 function __construct(Request $request, Response $response)
 {
     // Assign the request to the controller
     $this->request = $request;
     // Assign a response to the controller
     $this->response = $response;
     //login control, don't do it for auth controller so we dont loop
     if ($this->request->controller() != 'auth') {
         $url_bread = Route::url('oc-panel', array('controller' => 'home'));
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Panel'))->set_url($url_bread));
         //check if user is login
         if (!Auth::instance()->logged_in($request->controller(), $request->action(), $request->directory())) {
             Alert::set(Alert::ERROR, sprintf(__('You do not have permissions to access %s'), $request->controller() . ' ' . $request->action()));
             $url = Route::get('oc-panel')->uri(array('controller' => 'auth', 'action' => 'login'));
             $this->redirect($url);
         }
         //in case we are loading another theme since we use the allow query we force the configs of the selected theme
         if (Theme::$theme != Core::config('appearance.theme') and Core::config('appearance.allow_query_theme') == '1') {
             Theme::initialize(Core::config('appearance.theme'));
         }
     }
     //the user was loged in and with the right permissions
     parent::__construct($request, $response);
 }
开发者ID:demoic,项目名称:openclassifieds2,代码行数:28,代码来源:controller.php

示例5: __construct

 /**
  *
  * Contruct that checks you are loged in before nothing else happens!
  */
 function __construct(Request $request, Response $response)
 {
     //the user was loged in and with the right permissions
     parent::__construct($request, $response);
     // Assign the request to the controller
     $this->request = $request;
     // Assign a response to the controller
     $this->response = $response;
     //login control, don't do it for auth controller so we dont loop
     if ($this->request->controller() != 'auth') {
         $url_bread = Route::url('oc-panel', array('controller' => 'profile', 'action' => 'public'));
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('My Profile'))->set_url($url_bread));
         //check if user is login
         if (!Auth::instance()->logged_in($request->controller(), $request->action(), $request->directory())) {
             Alert::set(Alert::ERROR, __('You do not have permissions to access ' . $request->controller() . ' ' . $request->action()));
             $url = Route::url('oc-panel', array('controller' => 'auth', 'action' => 'login'));
             $this->redirect($url);
         }
         // Force configured theme in case mobile theme is selected
         if (Theme::$is_mobile) {
             Theme::initialize(Core::config('appearance.theme'));
         }
     }
 }
开发者ID:nick-catanchin-ie,项目名称:openclassifieds2,代码行数:28,代码来源:frontcontroller.php


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