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


PHP Tag::prependTitle方法代碼示例

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


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

示例1: initialize

 protected function initialize()
 {
     \Phalcon\Tag::prependTitle('PRIME | ');
     $this->view->setViewsDir('../app/views/');
     $this->view->setLayoutsDir('/layouts/');
     $this->view->setTemplateAfter('main');
 }
開發者ID:enricowillemse,項目名稱:prime_admin,代碼行數:7,代碼來源:ThemeCreatorController.php

示例2: initialize

 /**
  * 初始化
  */
 protected function initialize()
 {
     parent::initialize();
     //Prepend the application name to the title
     \Phalcon\Tag::prependTitle('Blog | ');
     $this->view->setTemplateAfter('common');
 }
開發者ID:hongker,項目名稱:Blog,代碼行數:10,代碼來源:BaseController.php

示例3: statisticAction

 public function statisticAction()
 {
     $id = $this->dispatcher->getParam('id');
     $banner = Banners::findFirst($id);
     if ($id && $banner && $banner->advertiser_id == $this->auth->get_user()->id) {
         $this->assets->collection('bottom-js')->addJs('js/moment/moment.min.js')->addJs('js/moment/ru.js')->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js');
         $this->assets->collection('css')->addCss('js/datetimepicker/css/bootstrap-datetimepicker.min.css');
         if (!$this->request->getQuery('start_date')) {
             if (!empty($banner->start_date)) {
                 $start_date = $banner->start_date;
             } else {
                 $first_view = $banner->views->getFirst()->date;
                 if (!empty($first_view)) {
                     $start_date = $first_view;
                 } else {
                     $start_date = 0;
                 }
             }
         } else {
             $start_date = date_parse_from_format('d.m.Y H:i', $this->request->getQuery('start_date'));
             $start_date = mktime($start_date['hour'], $start_date['minute'], 0, $start_date['month'], $start_date['day'], $start_date['year']);
         }
         if (!$this->request->getQuery('end_date')) {
             if (!empty($banner->end_date)) {
                 if ($banner->end_date > time()) {
                     $end_date = time();
                 } else {
                     $end_date = $banner->end_date;
                 }
             } else {
                 $end_date = time();
             }
         } else {
             $end_date = date_parse_from_format('d.m.Y H:i', $this->request->getQuery('end_date'));
             $end_date = mktime($end_date['hour'], $end_date['minute'], 0, $end_date['month'], $end_date['day'], $end_date['year']);
         }
         $days = floor(($end_date + 10800) / 86400) - floor(($start_date + 10800) / 86400) + 1;
         $days_arr = [];
         if ($days > 0) {
             for ($i = 0; $i < $days; $i++) {
                 $day = floor(($start_date + 10800) / 86400) * 86400 + $i * 86400 - 10800;
                 if ((!empty($banner->start_date) ? $day >= floor(($banner->start_date + 10800) / 86400) * 86400 - 10800 : true) && $day < (!empty($banner->end_date) ? $banner->end_date : time())) {
                     $days_arr[] = array('date' => $day, 'views' => $banner->countViews("date >= {$day} AND date < " . ($day + 86400)), 'clicks' => $banner->countViews("date >= {$day} AND date < " . ($day + 86400) . " AND clicked = 1"));
                 }
             }
         }
         $this->view->days = $days_arr;
         $q = "date >= {$start_date} AND date <= {$end_date}";
         $this->view->views = $banner->countViews(array($q));
         $q .= " AND clicked = 1";
         $this->view->clicks = $banner->countViews(array($q));
         $this->view->start_date = $start_date;
         $this->view->end_date = $end_date;
         $this->view->banner = $banner;
         $this->view->title = "Статистика для баннера \"{$banner->name}\"";
         \Phalcon\Tag::prependTitle("Статистика для баннера \"{$banner->name}\"");
     } else {
         $this->dispatcher->forward(array("namespace" => 'App\\Controllers', "controller" => "error", "action" => "notFound"));
     }
 }
開發者ID:atnartur,項目名稱:SimpleBannerRotator,代碼行數:60,代碼來源:BannersController.php

示例4: initialize

 public function initialize()
 {
     Tag::prependTitle('Fireball | ');
     $this->assets->collection('style')->addCss('third-party/css/bootstrap.min.css', false, false)->addCss('css/style.css')->setTargetPath('css/production.css')->setTargetUri('css/production.css')->join(true)->addFilter(new \Phalcon\Assets\Filters\Cssmin());
     //takes the js or css files and combines / minifies them for faster page loads
     $this->assets->collection('js')->addJs('third-party/js/jquery-1.12.0.min.js', false, false)->addJs('third-party/js/bootstrap.min.js', false, false)->setTargetPath('js/production.js')->setTargetUri('js/production.js')->join(true)->addFilter(new \Phalcon\Assets\Filters\Jsmin());
 }
開發者ID:BBK-PiJ-2014-83,項目名稱:learning-phalcon,代碼行數:7,代碼來源:BaseController.php

示例5: initialize

 /**
  * Initializes the controller
  */
 public function initialize()
 {
     Tag::prependTitle('HHF G&KB Awards | ');
     $this->_bc = new Breadcrumbs();
     $this->view->setVar('config', $this->config);
     $this->view->setVar('session', $this->session);
     $this->view->setVar('breadcrumbs', $this->_bc->generate());
 }
開發者ID:vnlita,項目名稱:phalcon-angular-harryhogfootball,代碼行數:11,代碼來源:Controller.php

示例6: initialize

 public function initialize()
 {
     Tag::prependTitle("Capelli Haarmode");
     // CSS imports
     $this->assets->collection('header')->addCss('https://fonts.googleapis.com/css?family=EB+Garamond')->addCss('css/datepicker.css')->addCss('css/materialize.min.css')->addCss('http://fonts.googleapis.com/icon?family=Material+Icons')->addCss('css/style.css');
     // JS imports
     $this->assets->collection('footer')->addJs('js/materialize.min.js')->addJs('js/script.js')->addJs('js/picker.js')->addJs('js/picker.date.js')->addJs('js/picker.time.js');
 }
開發者ID:Ugur22,項目名稱:capelli_haarmode,代碼行數:8,代碼來源:BaseController.php

示例7: uncaughtExceptionAction

 public function uncaughtExceptionAction()
 {
     $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
     $this->view->pick('error/error');
     \Phalcon\Tag::prependTitle('500');
     $this->view->title = "500 - внутренняя ошибка";
     $this->response->setStatusCode(500, 'Internal Server Error');
 }
開發者ID:atnartur,項目名稱:SimpleBannerRotator,代碼行數:8,代碼來源:ErrorController.php

示例8: initialize

 protected function initialize()
 {
     \Phalcon\Tag::prependTitle('PRIME | ');
     $this->view->setViewsDir('../app/views/');
     $this->view->setLayoutsDir('/layouts/');
     $this->view->setTemplateAfter('main');
     if ($this->session->has("auth")) {
         //Retrieve its value
         $auth = $this->session->get("auth");
         $this->organisation_id = $auth['organisation_id'];
     }
 }
開發者ID:enricowillemse,項目名稱:prime_admin,代碼行數:12,代碼來源:ProcessScheduledController.php

示例9: initialize

 /**
  * 初始化
  */
 protected function initialize()
 {
     parent::initialize();
     //Prepend the application name to the title
     \Phalcon\Tag::prependTitle('Blog | ');
     if ($this->checkIsLogin()) {
         $this->admin = $this->session->get('admin');
     } else {
         $this->response->redirect('/login', true);
     }
     $this->view->setTemplateAfter('common');
 }
開發者ID:hongker,項目名稱:Blog,代碼行數:15,代碼來源:BaseController.php

示例10: indexAction

 public function indexAction()
 {
     if ($this->request->getPost('txt')) {
         $content = $this->request->getPost('txt');
         copy('robots.txt', 'robots.txt.bak');
         file_put_contents('robots.txt', $content);
         $this->flashSession->success("Файл успешно сохранён");
     }
     $txt = file_get_contents('robots.txt');
     $this->view->txt = $txt;
     $this->view->title = "Редактирование файла robots.txt";
     Tag::prependTitle("Редактирование файла robots.txt");
 }
開發者ID:atnartur,項目名稱:SimpleBannerRotator,代碼行數:13,代碼來源:RobotsController.php

示例11: testSetTitleSeparator

 public function testSetTitleSeparator()
 {
     Tag::setTitle('Title');
     Tag::appendTitle('Class');
     $this->assertEquals(Tag::getTitle(), '<title>TitleClass</title>' . PHP_EOL);
     Tag::setTitle('Title');
     Tag::setTitleSeparator('|');
     Tag::appendTitle('Class');
     $this->assertEquals(Tag::getTitle(), '<title>Title|Class</title>' . PHP_EOL);
     $this->assertEquals(Tag::getTitleSeparator(), '|');
     Tag::setTitle('Title');
     Tag::setTitleSeparator('|');
     Tag::prependTitle('Class');
     $this->assertEquals(Tag::getTitle(), '<title>Class|Title</title>' . PHP_EOL);
 }
開發者ID:UqiOnline,項目名稱:cphalcon7,代碼行數:15,代碼來源:TagTest.php

示例12: profileAction

 public function profileAction()
 {
     $id = $this->dispatcher->getParam('id');
     $user = Users::findFirst($id);
     if ($user && $id) {
         if ($this->request->isPost()) {
             $action = $this->request->getPost('action');
             if ($action == "change_info") {
                 if ($user->update($this->request->getPost(), array('fname', 'lname', 'thname'))) {
                     $this->auth->refresh_user();
                     $this->flashSession->success("Информация о рекламодателе обновлена");
                 } else {
                     foreach ($user->getMessages() as $message) {
                         $this->flashSession->error($message->getMessage());
                     }
                 }
             } elseif ($action == "change_email") {
                 if ($user->update($this->request->getPost(), array('email'))) {
                     $this->auth->refresh_user();
                     $this->flashSession->success("E-mail рекламодателя изменён");
                 } else {
                     foreach ($user->getMessages() as $message) {
                         $this->flashSession->error($message->getMessage());
                     }
                 }
             } elseif ($action == "change_password") {
                 if ($this->request->getPost('password') === $this->request->getPost('password_confirm')) {
                     if ($user->update(array('password' => $this->auth->hash($this->request->getPost('password'))))) {
                         $this->auth->refresh_user();
                         $this->flashSession->success('Пароль рекламодателя успешно изменён');
                     } else {
                         foreach ($user->getMessages() as $message) {
                             $this->flashSession->error($message->getMessage());
                         }
                     }
                 } else {
                     $this->flashSession->error('Пароль и повтор пароля должны совпадать.');
                 }
             }
         }
         $this->view->user = $user;
         $this->view->title = $user->getUsername() . " - Управление";
         \Phalcon\Tag::prependTitle($user->getUsername() . " - Управление");
     } else {
         $this->dispatcher->forward(array("namespace" => 'App\\Controllers', "controller" => "error", "action" => "notFound"));
     }
 }
開發者ID:atnartur,項目名稱:SimpleBannerRotator,代碼行數:47,代碼來源:AdvertisersController.php

示例13: initialize

 /**
  * Everything a growing controller needs
  */
 protected function initialize()
 {
     // Page title
     $pageTitle = 'Talon | ' . $this->utilities->camelSeparate($this->dispatcher->getControllerName());
     $action = $this->dispatcher->getActionName();
     if ($action !== 'index') {
         $pageTitle .= ' | ' . $this->utilities->camelSeparate($action);
     }
     $this->view->setVar('page_title', $pageTitle);
     Tag::prependTitle($pageTitle);
     // Assets
     $this->assets->addCss('css/talon.css');
     $this->assets->addJs('js/talon.js');
     $this->view->setVar('jQuery', $this->includeJquery());
     $this->view->setVar('modernizr', $this->includeModernizr());
     $this->view->setTemplateAfter('main');
 }
開發者ID:fenghuilee,項目名稱:Talon,代碼行數:20,代碼來源:ControllerBase.php

示例14: initialize

    public function initialize(){

        Tag::prependTitle("Fireball | ");

        $this->assets->collection('style')
            ->addCss('css/bootstrap.min.css',false,false)
            ->addCss('css/style.css')
            ->setTargetPath('css/production.css')
            ->setTargetUri('css/production.css')
            ->join(true)
            ->addFilter(new \Phalcon\Assets\Filters\Cssmin());

        $this->assets->collection('js')
            ->addJs('js/jquery.min.js',false,false)
            ->addJs('js/bootstrap.min.js',false,false)
            ->setTargetPath('js/production.js')
            ->setTargetUri('js/production.js')
            ->join(true)
            ->addFilter(new \Phalcon\Assets\Filters\Jsmin());
    }
開發者ID:AhmadAborob,項目名稱:Phalcon-First-Project,代碼行數:20,代碼來源:ControllerBase.php

示例15: loginAction

 public function loginAction()
 {
     $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
     if ($this->router->getMatchedRoute()->getName() != 'auth') {
         $this->dispatcher->forward(array("controller" => "error", "action" => "notFound"));
     }
     \Phalcon\Tag::prependTitle('Вход');
     $this->view->title = "Вход";
     if ($this->auth->logged_in()) {
         return $this->response->redirect("");
     }
     if ($this->request->isPost()) {
         $auth = $this->auth->login($this->request->getPost('username'), $this->request->getPost('password'), (bool) $this->request->get('remember'));
         if ($auth) {
             return $this->response->redirect("");
         } else {
             $this->flashSession->error(':(');
         }
     }
     /*$user=new \App\Models\Users();
       $user->fname='Тест';
       $user->lname='Тестов';
       $user->thname='';
       $user->email='djdisc@mail.ru';
       $user->password='4444';
       if(!$user->create())
           foreach($user->getMessages() as $message) {
               $this->flashSession->error($message->getMessage());
           }
       else{
           $role = new \App\Models\RolesUsers();
           $role->user_id = $user->id;
           $role->role_id = \App\Models\Roles::findFirst(array('name="login"'))->id;
           $role->create();
           $role->role_id = \App\Models\Roles::findFirst(array('name="admin"'))->id;
           $role->create();
       }*/
     /*$admin = \App\Models\Users::findFirst(1);
       $admin->password = $this->auth->hash('ghfdbkj');
       $admin->save();*/
 }
開發者ID:atnartur,項目名稱:SimpleBannerRotator,代碼行數:41,代碼來源:IndexController.php


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