本文整理汇总了PHP中Template_Controller类的典型用法代码示例。如果您正苦于以下问题:PHP Template_Controller类的具体用法?PHP Template_Controller怎么用?PHP Template_Controller使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Template_Controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}
}
示例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
// }
}
示例3: before
public function before()
{
// For nagivation active link show
$path = $this->request->param('path');
$this->request->controller = substr($path, strpos($path, '/'));
parent::before();
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->administrator_model = new Administrator_Model();
$this->search = array('display' => '');
$this->_get_session_msg();
}
示例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));
}
示例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;
}
}
示例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
}
示例8: __construct
public function __construct()
{
parent::__construct();
$this->session = new Session();
// $profiler = new Profiler;
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->auth = Auth::instance();
$this->template->app_name = Kohana::config('bc.bc');
$this->template->page_title = __('Login');
}
示例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;
}
示例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();
}
示例12: __construct
public function __construct()
{
parent::__construct();
// This must be included
$this->search = array('keyword' => '');
$this->_get_submit();
}
示例13: Database
function __construct()
{
parent::__construct();
// Load site wide dependencies
$this->database = new Database();
$this->profiler = new Profiler();
}
示例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;
}
示例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();
}