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


PHP Phalcon\Tag類代碼示例

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


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

示例1: 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

示例2: initialize

 public function initialize()
 {
     $this->view->setTemplateAfter('main');
     $this->view->hdr = 'Купоны';
     Tag::setTitle('Coupons Panel');
     parent::initialize();
 }
開發者ID:serge2300,項目名稱:madeheart,代碼行數:7,代碼來源:CouponsController.php

示例3: initialize

 public function initialize()
 {
     \Phalcon\Tag::setTitle('登錄');
     parent::initialize();
     $this->view->setTemplateAfter('login_register');
     $this->operation = new UserOperation($this->di);
 }
開發者ID:hongker,項目名稱:Blog,代碼行數:7,代碼來源:LoginController.php

示例4: editAction

 public function editAction($id)
 {
     $fileStore = FileStore::findFirst($id);
     if ($fileStore == false) {
         $this->flash->error(_("Document was not found"));
         return $this->dispatcher->forward(array('action' => 'index'));
     }
     $request = $this->request;
     $userId = $this->auth->getIdentity();
     $form = new FileStoreForm($fileStore, array('edit' => true));
     if ($request->isPost()) {
         if ($form->isValid($request->getPost()) == true && $request->hasFiles() == true) {
             $fileStore = new FileStore();
             foreach ($request->getUploadedFiles() as $file) {
                 $fileStore->assign(array('id' => $id, 'fileName' => $file->getName(), 'fileCaption' => $request->getPost('fileCaption'), 'description' => $request->getPost('description'), 'categoriesId' => $request->getPost('categoriesId'), 'userId' => $userId['id'], 'mimeType' => $file->getType(), 'fileData' => file_get_contents($file->getTempName())));
                 if ($fileStore->update() == true) {
                     $this->flash->success(_("Update Document success"));
                     Tag::resetInput();
                     return $this->dispatcher->forward(array('action' => 'index'));
                 }
                 $this->flash->error($fileStore->getMessages());
             }
         }
     }
     $this->view->form = $form;
 }
開發者ID:kjmtrue,項目名稱:blog,代碼行數:26,代碼來源:FilestoreController.php

示例5: indexAction

 /**
  * The index action
  */
 public function indexAction()
 {
     if (!$this->request->isPost()) {
         Tag::setDefault('username', 'user@email.com');
         Tag::setDefault('password', 'hhf');
     }
 }
開發者ID:vnlita,項目名稱:phalcon-angular-harryhogfootball,代碼行數:10,代碼來源:SessionController.php

示例6: verifyAction

 public function verifyAction($code)
 {
     if ($code) {
         $results = VerifyEmail::FindFirst("verifyCode = '" . $code . "'");
         if (!isset($results->cid)) {
             return $this->response->redirect("index/index");
         }
         $form = new RegisterForm();
         if (isset($results) && $results != '') {
             if ($results->active == 'Y') {
                 if (md5($results->time . '+' . $results->email) == $code) {
                     $this->view->form = $form;
                     Tag::setDefault('password', null);
                     Tag::setDefault('cid', $results->cid);
                     Tag::setDefault('email', $results->email);
                     $this->view->setVar("email", $results->email);
                 } else {
                     $this->flash->error('郵箱驗證錯誤!');
                     $this->response->redirect("account/index");
                 }
             } else {
                 $this->flash->error('郵箱已經驗證通過,請登錄!');
                 $this->response->redirect("account/index");
             }
         } else {
             $this->flash->error('驗證碼已過期!');
             $this->response->redirect("index/index");
         }
     } else {
         $this->response->redirect("index/index");
     }
 }
開發者ID:lookingatsky,項目名稱:zhonghewanbang,代碼行數:32,代碼來源:AccountController.php

示例7: outputCss

 /**
  * Prints the HTML for CSS resources
  *
  * @param string $collectionName the name of the collection
  *
  * @return string the result of the collection
  **/
 public function outputCss($collectionName = null)
 {
     $collection = $this->collection($collectionName);
     if ($collection->getJoin()) {
         $filename = $collection->getTargetPath();
         if (file_exists($filename)) {
             $time = 0;
             foreach ($collection->getResources() as $resource) {
                 $tmp = filemtime($resource->getRealTargetPath());
                 if ($tmp > $time) {
                     $time = $tmp;
                 }
             }
             // If created
             if (filemtime($filename) > $time) {
                 $collection->setTargetUri($collection->getTargetUri() . '?' . filemtime($filename));
                 return Tag::stylesheetLink($collection->getTargetUri());
             }
         }
         // Else CREATE
         $res = parent::outputCss($collectionName);
         return $res;
     }
     return parent::outputCss($collectionName);
 }
開發者ID:atduarte,項目名稱:allsos,代碼行數:32,代碼來源:AssetsManager.php

示例8: 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

示例9: profileAction

 public function profileAction()
 {
     $auth = $this->session->get('auth');
     $user = Users::findFirst($auth['id']);
     if ($user == false) {
         $this->_forward('index/index');
     }
     $request = $this->request;
     if (!$request->isPost()) {
         Tag::setDefault('name', $user->name);
         Tag::setDefault('email', $user->email);
     } else {
         $name = $request->getPost('name', 'string');
         $email = $request->getPost('email', 'email');
         $name = strip_tags($name);
         $user->name = $name;
         $user->email = $email;
         if ($user->save() == false) {
             foreach ($user->getMessages() as $message) {
                 $this->flash->error((string) $message);
             }
         } else {
             $this->flash->success('更新成功');
         }
     }
 }
開發者ID:lookingatsky,項目名稱:zhonghewanbang,代碼行數:26,代碼來源:InvoicesController.php

示例10: initialize

 public function initialize()
 {
     Tag::setTitle('About');
     parent::initialize();
     $this->_bc->add('About', 'about');
     $this->view->setVar('menus', $this->constructMenu($this));
 }
開發者ID:vnlita,項目名稱:phalcon-angular-harryhogfootball,代碼行數:7,代碼來源:AboutController.php

示例11: run

 public function run()
 {
     $this->assets->outputCss();
     $this->assets->outputJs();
     echo Tag::textArea(array("{$this->id}", "name" => "{$this->name}"));
     echo '<div class="hint"><a onclick="return setupElrteEditor(\'' . $this->id . '\', this, \'' . $this->theme . '\', \'' . $this->height . '\');">WYSIWYG</a></div>';
 }
開發者ID:devsnippet,項目名稱:city_site,代碼行數:7,代碼來源:ElrteArea.php

示例12: 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

示例13: run

 public function run()
 {
     $faker = Faker::create();
     $log = new Stream('php://stdout');
     $log->info('Start ' . __CLASS__);
     /** @var Phalcon\Db\AdapterInterface $database */
     $database = $this->getDI()->get('db');
     $database->begin();
     for ($i = 0; $i <= self::TAGS_TOTAL; $i++) {
         $title = $faker->company;
         $description = $faker->text;
         $tags = new Tags();
         $tags->name = $title;
         $tags->slug = \Phalcon\Tag::friendlyTitle($title);
         $tags->numberPosts = 0;
         $tags->noBounty = 'N';
         $tags->noDigest = 'N';
         $tags->description = $description;
         if (!$tags->save()) {
             var_dump($tags->getMessages());
             $database->rollback();
             die;
         }
         $log->info('tags: ' . $tags->getName());
     }
 }
開發者ID:gitter-badger,項目名稱:phanbook,代碼行數:26,代碼來源:TagsSeeder.php

示例14: loginAction

 /**
  * Starts a session in the admin backend
  */
 public function loginAction()
 {
     \Phalcon\Tag::appendTitle(" - Вход");
     $form = new LoginForm();
     try {
         if (!$this->request->isPost()) {
             if ($this->auth->hasRememberMe()) {
                 return $this->auth->loginWithRememberMe();
             }
         } else {
             if ($form->isValid($this->request->getPost()) == false) {
                 foreach ($form->getMessages() as $message) {
                     $this->flash->error($message);
                 }
             } else {
                 $this->auth->check(array('email' => $this->request->getPost('email', 'email'), 'password' => $this->request->getPost('password'), 'remember' => $this->request->getPost('remember')));
                 $auth = $this->session->get('auth');
                 $this->flashSession->notice($auth['role']);
                 if (!$auth) {
                     $this->flashSession->notice("Нужно войти или зарегистрироваться");
                     return $this->response->redirect("session/login");
                 }
                 if ($auth['role'] == 'Administrators') {
                     $this->flashSession->success("Здравствуйте администратор. Вы находитесь в области управления сайтом, в разделе Новости.");
                     return $this->response->redirect("backend/news");
                 }
                 return $this->response->redirect();
             }
         }
     } catch (AuthException $e) {
         $this->flash->error($e->getMessage());
     }
     $this->view->form = $form;
 }
開發者ID:devsnippet,項目名稱:city_site,代碼行數:37,代碼來源:SessionController.php

示例15: 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


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