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


PHP Navigation::getURL方法代码示例

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


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

示例1: execute

 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     //--Get the id
     $id = $this->URL->getParameter(1);
     //--check if the id is not empty
     if (empty($id)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Explode the id
     $ids = explode("-", $id);
     //--check if the id contains 2 elements
     if (count($ids) != 2) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Get the ids and decrypt
     $send_id = (int) FrontendMailengineModel::decryptId($ids[0]);
     $user_id = (int) FrontendMailengineModel::decryptId($ids[1]);
     //--check if the ids are integers
     if ($send_id <= 0) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     if ($user_id > 0) {
         $data = array();
         $data["send_id"] = $send_id;
         $data["user_id"] = $user_id;
         //--Add open-mail to the database
         FrontendMailengineModel::insertMailOpen($data);
     }
     //--Create an empty image
     $this->createImage();
     //--Stop the script
     die;
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:37,代码来源:MailengineImage.php

示例2: execute

 /**
  * Execute the extra.
  */
 public function execute()
 {
     // get activation key
     $key = $this->URL->getParameter(0);
     // load template
     $this->loadTemplate();
     // do we have an activation key?
     if (isset($key)) {
         // get profile id
         $profileId = FrontendProfilesModel::getIdBySetting('activation_key', $key);
         // have id?
         if ($profileId != null) {
             // update status
             FrontendProfilesModel::update($profileId, array('status' => 'active'));
             // delete activation key
             FrontendProfilesModel::deleteSetting($profileId, 'activation_key');
             // login profile
             FrontendProfilesAuthentication::login($profileId);
             // trigger event
             FrontendModel::triggerEvent('Profiles', 'after_activate', array('id' => $profileId));
             // show success message
             $this->tpl->assign('activationSuccess', true);
         } else {
             // failure
             $this->redirect(FrontendNavigation::getURL(404));
         }
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:33,代码来源:Activate.php

示例3: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // fetch record
     $this->record = FrontendTagsModel::get($this->URL->getParameter(1));
     // validate record
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // fetch modules
     $this->modules = FrontendTagsModel::getModulesForTag($this->record['id']);
     // loop modules
     foreach ($this->modules as $module) {
         // get the ids of the items linked to the tag
         $otherIds = (array) $this->get('database')->getColumn('SELECT other_id
              FROM modules_tags
              WHERE module = ? AND tag_id = ?', array($module, $this->record['id']));
         // set module class
         $class = 'Frontend\\Modules\\' . $module . '\\Engine\\Model';
         // get the items that are linked to the tags
         $items = (array) FrontendTagsModel::callFromInterface($module, $class, 'getForTags', $otherIds);
         // add into results array
         if (!empty($items)) {
             $this->results[] = array('name' => $module, 'label' => FL::lbl(\SpoonFilter::ucfirst($module)), 'items' => $items);
         }
     }
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:33,代码来源:Detail.php

示例4: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get by URL
     $this->record = FrontendFaqModel::get($this->URL->getParameter(1));
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // overwrite URLs
     $this->record['category_full_url'] = FrontendNavigation::getURLForBlock('Faq', 'Category') . '/' . $this->record['category_url'];
     $this->record['full_url'] = FrontendNavigation::getURLForBlock('Faq', 'Detail') . '/' . $this->record['url'];
     // get tags
     $this->record['tags'] = FrontendTagsModel::getForItem('Faq', $this->record['id']);
     // get settings
     $this->settings = $this->get('fork.settings')->getForModule('Faq');
     // reset allow comments
     if (!$this->settings['allow_feedback']) {
         $this->record['allow_feedback'] = false;
     }
     // ge status
     $this->status = $this->URL->getParameter(2);
     if ($this->status == FL::getAction('Success')) {
         $this->status = 'success';
     }
     if ($this->status == FL::getAction('Spam')) {
         $this->status = 'spam';
     }
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:35,代码来源:Detail.php

示例5: execute

 /**
  * Execute the extra.
  */
 public function execute()
 {
     // get reset key
     $key = $this->URL->getParameter(0);
     // do we have an reset key?
     if (isset($key)) {
         // load parent
         parent::execute();
         // load template
         $this->loadTemplate();
         // get profile id
         $profileId = FrontendProfilesModel::getIdBySetting('forgot_password_key', $key);
         // have id?
         if ($profileId !== 0) {
             // load
             $this->loadForm();
             // validate
             $this->validateForm();
         } elseif ($this->URL->getParameter('sent') != 'true') {
             $this->redirect(FrontendNavigation::getURL(404));
         }
         // parse
         $this->parse();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:30,代码来源:ResetPassword.php

示例6: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // get categories
     $categories = FrontendBlogModel::getAllCategories();
     $possibleCategories = array();
     foreach ($categories as $category) {
         $possibleCategories[$category['url']] = $category['id'];
     }
     // requested category
     $requestedCategory = \SpoonFilter::getValue($this->URL->getParameter(1, 'string'), array_keys($possibleCategories), 'false');
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // validate category
     if ($requestedCategory == 'false') {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // set category
     $this->category = $categories[$possibleCategories[$requestedCategory]];
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('Blog', 'Category') . '/' . $requestedCategory;
     $this->pagination['limit'] = $this->get('fork.settings')->get('Blog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendBlogModel::getAllForCategoryCount($requestedCategory);
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // redirect if the request page doesn't exists
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
     // get articles
     $this->items = FrontendBlogModel::getAllForCategory($requestedCategory, $this->pagination['limit'], $this->pagination['offset']);
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:37,代码来源:Category.php

示例7: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('catalog');
     $this->pagination['limit'] = FrontendModel::getModuleSetting('catalog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendCatalogModel::getAllCount();
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // num pages is always equal to at least 1
     if ($this->pagination['num_pages'] == 0) {
         $this->pagination['num_pages'] = 1;
     }
     // redirect if the request page doesn't exist
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
     // get all categories
     $this->categories = FrontendCatalogModel::getAllCategories();
     // get tree of all categories
     $this->categoriesTree = FrontendCatalogModel::getCategoriesTree();
     // get all products
     $this->products = FrontendCatalogModel::getAll($this->pagination['limit'], $this->pagination['offset']);
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:31,代码来源:Index.php

示例8: redirectLink

 protected function redirectLink($link_id)
 {
     //--Get the link
     $link = FrontendMailengineModel::getLink($link_id);
     //--Check if the link is empty -> redirect 404
     if (empty($link)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Redirect
     $this->redirect($link["url"]);
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:11,代码来源:MailengineClick.php

示例9: execute

 /**
  * Execute the extra
  */
 public function execute()
 {
     $this->id = $this->URL->getParameter(1);
     // validate incoming parameters
     if ($this->id === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     parent::execute();
     $this->loadTemplate();
     $this->getData();
     $this->parse();
 }
开发者ID:andsci,项目名称:hotels,代码行数:15,代码来源:Detail.php

示例10: loadData

 /**
  * Load the data
  */
 protected function loadData()
 {
     //--Check the params
     if ($this->URL->getParameter(0) === null) {
         $this->redirect(FrontendNavigation::getURL(404), 404);
     }
     //--Get record
     $this->record = FrontendAddressesModel::get($this->URL->getParameter(1));
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404), 307);
     }
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:15,代码来源:Detail.php

示例11: execute

 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     //--Get the id
     $this->id = \SpoonFilter::getGetValue('id', null, 0, 'int');
     //--Check if mailing exist
     if (!FrontendMailengineModel::extistSend($this->id)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     $this->loadTemplate();
     $this->loadData();
     $this->parse();
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:16,代码来源:MailengineDetail.php

示例12: execute

 /**
  * Execute the extra
  */
 public function execute()
 {
     // profile not logged in
     if (!FrontendProfilesAuthentication::isLoggedIn()) {
         parent::execute();
         $this->loadTemplate();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } else {
         // profile logged in
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:17,代码来源:ResendActivation.php

示例13: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get by URL
     $this->record = FrontendFaqModel::getCategory($this->URL->getParameter(1));
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     $this->record['full_url'] = FrontendNavigation::getURLForBlock('Faq', 'Category') . '/' . $this->record['url'];
     $this->questions = FrontendFaqModel::getAllForCategory($this->record['id']);
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:18,代码来源:Category.php

示例14: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get record
     $this->record = FrontendBlogModel::get($this->URL->getParameter(1));
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get articles
     $this->items = FrontendBlogModel::getComments($this->record['id']);
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:18,代码来源:ArticleCommentsRss.php

示例15: getData

 /**
  * Get the data
  *
  * @return void
  */
 private function getData()
 {
     // check for errors
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get the gallery meta based on the url
     $this->record = FrontendSlideshowModel::getGalleriesByURL($this->URL->getParameter(1));
     // redirect if nothing is found
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // full url asset
     $this->full_url = FrontendNavigation::getURLForBlock('Slideshow', 'detail');
     $this->full_url_category = FrontendNavigation::getURLForBlock('Slideshow', 'category');
 }
开发者ID:bart-webleads,项目名称:fork-cms-module-slideshow,代码行数:21,代码来源:Category.php


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