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

PHP Template_Controller类代码示例

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

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



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

示例1: envoyer

 /**
  * Methode : page envoyer le mailing
  */
 public function envoyer()
 {
     if ($_POST) {
         $texte = $this->input->post('texte');
         $format = $this->input->post('format');
         $sujet = $this->input->post('sujet');
         $format = $format == 1 ? TRUE : FALSE;
         $users = $this->user->select();
         $nbr_envois = 0;
         foreach ($users as $user) {
             if ($format) {
                 $view = new View('mailing/template');
                 $view->name = ucfirst(mb_strtolower($user->username));
                 $view->content = $texte;
                 $message = $view->render();
             } else {
                 $message = $texte;
             }
             if (email::send($user->email, Kohana::config('email.from'), $sujet, $message, $format)) {
                 $nbr_envois++;
             }
         }
         return url::redirect('mailing?msg=' . urlencode(Kohana::lang('mailing.send_valide', number_format($nbr_envois))));
     } else {
         return parent::redirect_erreur('mailing');
     }
 }
开发者ID:ezioms,项目名称:RpgEditor,代码行数:30,代码来源:mailing.php


示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template->links = array('Home' => 'home', 'Browse' => 'folders', 'Search' => 'search', 'About' => 'about', 'Contact' => 'contact');
     $this->db = Database::instance();
     // makes database object available to all controllers
     $this->session = Session::instance();
     $authentic = new Auth();
     if ($authentic->logged_in() || $authentic->auto_login()) {
         $this->user = $authentic->get_user();
     } else {
         $this->session->set("requested_url", "/" . url::current());
         // this will redirect from the login page back to this page
         url::redirect('/auth/login');
     }
     // if ($authentic->auto_login()) {
     //     $this->user = $authentic->get_user();
     //     url::redirect('/document/view/1');
     // }
     // if (!$authentic->logged_in()) {
     //
     //     $this->session->set("requested_url","/".url::current()); // this will redirect from the login page back to this page
     //     url::redirect('/auth/login');
     // } else {
     //     $this->user = $authentic->get_user(); //now you have access to user information stored in the database
     // }
 }
开发者ID:jokke,项目名称:ORL,代码行数:27,代码来源:website.php


示例3: before

 public function before()
 {
     // For nagivation active link show
     $path = $this->request->param('path');
     $this->request->controller = substr($path, strpos($path, '/'));
     parent::before();
 }
开发者ID:Burgestrand,项目名称:Anglarna-Stockholm,代码行数:7,代码来源:static.php


示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->administrator_model = new Administrator_Model();
     $this->search = array('display' => '');
     $this->_get_session_msg();
 }
开发者ID:vobinh,项目名称:PHP,代码行数:7,代码来源:admin_account.php


示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $active = $this->uri->segment(2) ? $this->uri->segment(2) : 'core';
     // Add the menu to the template
     $this->template->menu = new View('kodoc/menu', array('active' => $active));
 }
开发者ID:darkcolonist,项目名称:kohana234-doctrine115,代码行数:7,代码来源:kodoc.php


示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/home');
     // Init session
     $this->_get_session_template();
     $this->questionnaires_model = new Questionnaires_Model();
     $this->answer_model = new Answer_Model();
     $this->category_model = new Category_Model();
     $this->test_model = new Test_Model();
     $this->testing_model = new Testing_Model();
     $this->payment_model = new Payment_Model();
     $this->testingdetail_model = new Testingdetail_Model();
     $this->testing_category_model = new Testingcategory_Model();
     $this->promotion_model = new Promotion_Model();
     $this->courses_model = new Courses_Model();
     $this->study_model = new Study_Model();
     $this->lesson_model = new Lesson_Model();
     $this->lesson_annotation_model = new Lesson_annotation_Model();
     $this->member_certificate_model = new Member_certificate_Model();
     $this->certificate_model = new Certificate_Model();
     $this->data_template_model = new Data_template_Model();
     if ($this->sess_cus == "") {
         url::redirect(url::base());
         die;
     }
 }
开发者ID:vobinh,项目名称:PHP,代码行数:27,代码来源:courses.php


示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/index');
     $this->articles_model = new Articles_Model();
     //View
 }
开发者ID:vobinh,项目名称:PHP,代码行数:7,代码来源:article.php


示例8: __construct

    public function __construct()
    {
        parent::__construct();
		
        $this->session = new Session();
		// $profiler = new Profiler;
    }
开发者ID:nurous,项目名称:bushfireconnect,代码行数:7,代码来源:login.php


示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->auth = Auth::instance();
     $this->template->app_name = Kohana::config('bc.bc');
     $this->template->page_title = __('Login');
 }
开发者ID:carriercomm,项目名称:billing_cart,代码行数:7,代码来源:login.php


示例10: __construct

 public function __construct()
 {
     parent::__construct();
     // Load cache
     $this->cache = new Cache();
     // Load session
     $this->session = new Session();
     // Load database
     $this->db = new Database();
     $this->auth = new Auth();
     $this->session = Session::instance();
     $this->auth->auto_login();
     if (!$this->auth->logged_in('admin') && !$this->auth->logged_in('login')) {
         url::redirect('login');
     }
     //fetch latest version of ushahidi
     $version_number = $this->_fetch_core_version();
     $this->template->version = $this->_find_core_version($version_number);
     // Get Session Information
     $user = new User_Model($_SESSION['auth_user']->id);
     $this->template->admin_name = $user->name;
     // Retrieve Default Settings
     $this->template->site_name = Kohana::config('settings.site_name');
     $this->template->mapstraction = Kohana::config('settings.mapstraction');
     $this->template->api_url = Kohana::config('settings.api_url');
     // Javascript Header
     $this->template->map_enabled = FALSE;
     $this->template->flot_enabled = FALSE;
     $this->template->protochart_enabled = FALSE;
     $this->template->colorpicker_enabled = FALSE;
     $this->template->editor_enabled = FALSE;
     $this->template->js = '';
     // Load profiler
     // $profiler = new Profiler;
 }
开发者ID:newrooky,项目名称:Ushahidi_Web,代码行数:35,代码来源:admin.php


示例11: __construct

 public function __construct()
 {
     socialFeed::get_favicon_from('http://www.delicious.com/sydlawrence');
     $this->session = Session::instance();
     $this->db = new Database();
     parent::__construct();
     $_POST = $this->input->xss_clean($_POST);
     if ($this->input->post('attempt_login')) {
         $return = login::attempt_login();
         if (isset($return->id) && $return->id > 0) {
             $this->user = $return;
         } else {
             $this->__set_options(array('error' => $return));
         }
         if (isset($_GET['redirect'])) {
             url::redirect(urldecode($_GET['redirect']));
         }
     }
     $this->user = login::check_login();
     if ($this->input->get('logout')) {
         Auth::instance()->logout(TRUE);
         url::redirect();
     }
     $this->page = Page_Model::get_by_url();
     $this->feed = Feed_Model::get_by_url();
     $this->feedpost = Feedpost_Model::get_by_url();
     $this->__setup();
     $this->header = new View('includes/header');
     $this->footer = new View('includes/footer');
     $this->__binds();
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:31,代码来源:zest.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     // This must be included
     $this->search = array('keyword' => '');
     $this->_get_submit();
 }
开发者ID:vobinh,项目名称:PHP,代码行数:7,代码来源:admin_menu_category.php


示例13: Database

 function __construct()
 {
     parent::__construct();
     // Load site wide dependencies
     $this->database = new Database();
     $this->profiler = new Profiler();
 }
开发者ID:kevinroberts,项目名称:snippetz,代码行数:7,代码来源:website.php


示例14: __construct

 public function __construct()
 {
     parent::__construct();
     // Inicio de Session
     $this->session = Session::instance();
     // Si la variable cat no está definida, definirla
     if (!isset($_SESSION['cat'])) {
         $_SESSION['cat'] = 0;
     }
     if (!isset($_SESSION['localidad'])) {
         $_SESSION['localidad'] = 0;
     }
     $this->template->links = array('Acerca de IMGListados' => 'about', 'Datos' => 'datos', 'Rubros' => 'rubros', 'Exportar Listados' => 'listados');
     $this->template->footer = 'Copyright ' . $this->thiYear($this->y) . ' - ' . html::anchor('http://www.imgdigital.com.ar', 'IMG Digital', array('target' => '_blank')) . '- ' . html::anchor('http://www.imgdigital.com.ar/imglistados', 'IMGListados', array('target' => '_blank'));
     $this->template->login = new View('login');
     // Da acceso a todos los controladores la base de datos
     $this->db = Database::instance();
     //Listado de Categorías
     $this->categorias = ORM::factory('categoria')->select_list();
     //$this->template->cats =  $this->categorias;
     //Listado de Localidades
     $this->localidades = ORM::factory('localidad')->select_list();
     //$this->template->localidades = $this->localidades;
     //$this->profiler = new Profiler;
 }
开发者ID:bicho44,项目名称:imglistados,代码行数:25,代码来源:website.php


示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/index');
     $this->_get_session_template();
     $this->login_model = new Login_Model();
 }
开发者ID:vobinh,项目名称:PHP,代码行数:7,代码来源:login.php


示例16: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template = new View('templates/' . $this->site['config']['TEMPLATE'] . '/client/index');
     // Init session
     $this->_get_session();
 }
开发者ID:vobinh,项目名称:PHP,代码行数:7,代码来源:contact.php


示例17: __construct

 public function __construct()
 {
     parent::__construct();
     //$this->session = Session::instance();
     //$this->auth = new Auth;
     // Check to see if the request is a HXR call
     if (request::is_ajax()) {
         // Send the 403 header
         header('HTTP/1.1 403 Forbidden');
         //$t = new View('blank');
         return;
     }
     /*
     		if (Kohana::config_load('cw', true))
     			$this->cfg  = Kohana::config('cw');
     */
     /*		if (IN_PRODUCTION === FALSE)
     		{
     			$this->profiler = new Profiler;
     		}*/
     $t =& $this->template;
     $t->header = new View('components/header');
     $t->footer = new View('components/footer');
     //$this->db = Database::instance();
 }
开发者ID:holandacz,项目名称:nb4,代码行数:25,代码来源:mywebsite.php


示例18: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template->title = 'Kohana Forum';
     # configure filters.
     $url_array = $this->uri->segment_array();
     $this->action = empty($url_array['2']) ? 'category' : $url_array['2'];
     $this->filter = isset($url_array['3']) ? $url_array['3'] : '';
     $this->filter2 = isset($url_array['4']) ? $url_array['4'] : '';
     # configure sorters.
     $this->sort = isset($_GET['sort']) ? $_GET['sort'] : 'newest';
     $this->sort_by = (empty($_GET['sort']) or 'votes' == $_GET['sort']) ? 'vote_count' : 'created';
     $this->order = (empty($_GET['sort']) or 'oldest' != $_GET['sort']) ? 'desc' : 'asc';
     /*
      * Notes:
      * We make everything run through _index or _ajax
      * because it's easier to delegate modular functionality
      * based on whether a request is ajax or not.
      * mapping publically (i.e. site.com/controller/method)
      * would mean we'd have to have ajax/non-ajax logic within each method
      * which i think is harder to maintain and read.
      */
     # handle ajax requests of course =0
     if (request::is_ajax()) {
         die($this->_ajax());
     }
     # handle non-ajax.
     die($this->_index());
 }
开发者ID:plusjade,项目名称:kohana-fizzle,代码行数:29,代码来源:forum.php


示例19: __construct

 public function __construct()
 {
     $this->test_model = new Test_Model();
     $this->payment_model = new Payment_Model();
     parent::__construct();
     $this->_get_session_msg();
 }
开发者ID:vobinh,项目名称:PHP,代码行数:7,代码来源:admin_test.php


示例20: before

 public function before()
 {
     parent::before();
     $param = $this->request->param('forum');
     $forum = Model_Forum::factory($param)->load();
     try {
         if (!$forum->loaded()) {
             throw new Kohana_Exception('Forumet :forum existerar inte.', array(':forum' => $param));
         }
         $roles = $forum->roles->as_array(NULL, 'name');
         if (!$this->auth->has_roles($roles)) {
             throw new Kohana_Exception('Du måste vara inloggad för att ha tillgång till forum/:forum.', array(':forum' => $forum->name));
         }
     } catch (Kohana_Exception $e) {
         $this->message_add($e->getMessage(), 'error');
         $this->request->redirect('forum');
     }
     // Save forum for later use
     $this->_forum = $forum;
     // REST-thingy
     switch (Request::$method) {
         case 'POST':
             $this->request->action = 'create';
             break;
         case 'DELETE':
             $this->request->action = 'delete';
             break;
     }
 }
开发者ID:Burgestrand,项目名称:Anglarna-Stockholm,代码行数:29,代码来源:forum.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Template_Helper类代码示例发布时间:2022-05-23
下一篇:
PHP TemplateRendererFactory类代码示例发布时间: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