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


PHP FrontController::initContent方法代码示例

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


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

示例1: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     header('HTTP/1.1 404 Not Found');
     header('Status: 404 Not Found');
     parent::initContent();
     $this->setTemplate(_PS_THEME_DIR_ . '404.tpl');
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:11,代码来源:PageNotFoundController.php

示例2: initContent

 public function initContent()
 {
     //pass data to template file
     $this->setTemplate(_PS_THEME_DIR_ . 'remboursementDon.tpl');
     //call parent initcontent - this is for loading the site's default header, footer, left and right columns
     parent::initContent();
 }
开发者ID:yewed,项目名称:share,代码行数:7,代码来源:RemboursementDonController.php

示例3: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->addJS(_THEME_JS_DIR_ . 'index.js');
     $this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'), 'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'), 'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')));
     $this->setTemplate(_PS_THEME_DIR_ . 'index.tpl');
 }
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:11,代码来源:IndexController.php

示例4: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     header('HTTP/1.1 404 Not Found');
     header('Status: 404 Not Found');
     if (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('png', 'jpg', 'gif'))) {
         $this->context->cookie->disallowWriting();
         if ((bool) Configuration::get('PS_REWRITING_SETTINGS')) {
             preg_match('#([0-9]+)(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/(.+)\\.(png|jpg|gif)$#', $_SERVER['REQUEST_URI'], $matches);
         }
         if ((!isset($matches[2]) || empty($matches[2])) && !(bool) Configuration::get('PS_REWRITING_SETTINGS')) {
             preg_match('#/([0-9]+)(\\-[_a-zA-Z]*)\\.(png|jpg|gif)$#', $_SERVER['REQUEST_URI'], $matches);
         }
         if (is_array($matches) && !empty($matches[2]) && Tools::strtolower(substr($matches[2], -8)) != '_default' && is_numeric($matches[1])) {
             $matches[2] = substr($matches[2], 1, Tools::strlen($matches[2])) . '_default';
             if (!isset($matches[4])) {
                 $matches[4] = '';
             }
             header('Location: ' . $this->context->link->getImageLink($matches[4], $matches[1], $matches[2]), true, 302);
             exit;
         }
         header('Content-Type: image/gif');
         readfile(_PS_IMG_DIR_ . '404.gif');
         exit;
     } elseif (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('.js', 'css'))) {
         $this->context->cookie->disallowWriting();
         exit;
     }
     parent::initContent();
     $this->setTemplate(_PS_THEME_DIR_ . '404.tpl');
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:34,代码来源:PageNotFoundController.php

示例5: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->addJS(_THEME_JS_DIR_ . 'index.js');
     $this->addJS(_THEME_JS_DIR_ . 'modernizr.custom.js');
     $this->addJS(_THEME_JS_DIR_ . 'toucheffects.js');
     $this->addJS(_THEME_JS_DIR_ . 'supplier_list.js');
     $this->addJS(_THEME_JS_DIR_ . 'jquery.bxslider.js');
     $this->addJS(_THEME_JS_DIR_ . 'header.js');
     $this->addJS(_THEME_JS_DIR_ . 'waypoints.min.js');
     $this->addJS(_THEME_JS_DIR_ . 'jquery.counterup.min.js');
     $this->addJS(_THEME_JS_DIR_ . 'front.js');
     $supplier = new SupplierControllerCore();
     if ($idCategory == null) {
         $supplier->initContent($this->idCategory);
     } else {
         $supplier->initContent($this->idCategory);
     }
     /**
      * get categories level 2 for present them in header
      **/
     $categories = Category::getChildrenWithNbSelectedSubCat(2, '', true, null, true);
     $this->context->smarty->assign(array('categories' => $categories));
     $this->assignKPI();
     /*$this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'),
           'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'),
           'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')
       ));*/
     $this->setTemplate(_PS_THEME_DIR_ . 'index.tpl');
 }
开发者ID:yewed,项目名称:share,代码行数:34,代码来源:IndexController.php

示例6: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign('about_shop_cart', true);
     //print_r($_POST);
     //print '<br><br>';
     //print_r($this->errors);
     $this->context->smarty->assign('genders', Gender::getGenders());
     $this->assignDate();
     $this->assignCountries();
     $this->context->smarty->assign('newsletter', 1);
     $back = Tools::getValue('back');
     $key = Tools::safeOutput(Tools::getValue('key'));
     if (!empty($key)) {
         $back .= (strpos($back, '?') !== false ? '&' : '?') . 'key=' . $key;
     }
     if ($back == Tools::secureReferrer(Tools::getValue('back'))) {
         $this->context->smarty->assign('back', html_entity_decode($back));
     } else {
         $this->context->smarty->assign('back', Tools::safeOutput($back));
     }
     if (Tools::getValue('display_guest_checkout')) {
         if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
             $countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
         } else {
             $countries = Country::getCountries($this->context->language->id, true);
         }
         if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
             // get all countries as language (xy) or language-country (wz-XY)
             $array = array();
             preg_match("#(?<=-)\\w\\w|\\w\\w(?!-)#", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $array);
             if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0]))) {
                 $sl_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
             }
         } else {
             $sl_country = (int) Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
         }
         $this->context->smarty->assign(array('inOrderProcess' => true, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'sl_country' => (int) $sl_country, 'countries' => $countries));
     }
     if (Tools::getValue('create_account')) {
         $this->context->smarty->assign('email_create', 1);
     }
     if (Tools::getValue('multi-shipping') == 1) {
         $this->context->smarty->assign('multi_shipping', true);
     } else {
         $this->context->smarty->assign('multi_shipping', false);
     }
     $this->assignAddressFormat();
     // Call a hook to display more information on form
     $this->context->smarty->assign(array('HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
     // Just set $this->template value here in case it's used by Ajax
     $this->setTemplate(_PS_THEME_DIR_ . 'authentication.tpl');
     if ($this->ajax) {
         // Call a hook to display more information on form
         $this->context->smarty->assign(array('PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'genders' => Gender::getGenders(), 'ajax_isset' => 1));
         $return = array('hasError' => !empty($this->errors), 'errors' => $this->errors, 'page' => $this->context->smarty->fetch($this->template), 'token' => Tools::getToken(false));
         die(Tools::jsonEncode($return));
     }
 }
开发者ID:,项目名称:,代码行数:63,代码来源:

示例7: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $has_address = $this->context->customer->getAddresses($this->context->language->id);
     $this->context->smarty->assign(array('has_customer_an_address' => empty($has_address), 'voucherAllowed' => (int) CartRule::isFeatureActive(), 'returnAllowed' => (int) Configuration::get('PS_ORDER_RETURN')));
     $this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('displayCustomerAccount'));
     $this->setTemplate(_PS_THEME_DIR_ . 'my-account.tpl');
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:12,代码来源:MyAccountController.php

示例8: initContent

 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $this->setTemplate('customer/order-return');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:13,代码来源:OrderReturnController.php

示例9: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false);
     $nb_cart_rules = count($cart_rules);
     $this->context->smarty->assign(array('nb_cart_rules' => (int) $nb_cart_rules, 'cart_rules' => $cart_rules));
     $this->setTemplate(_PS_THEME_DIR_ . 'discount.tpl');
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:12,代码来源:DiscountController.php

示例10: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => Product::getPricesDrop($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'prices-drop.tpl');
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:13,代码来源:PricesDropController.php

示例11: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     if (count($this->context->customer->getSimpleAddresses()) <= 0) {
         $link = '<a href="' . $this->context->link->getPageLink('address', true) . '">' . $this->trans('Add a new address', array(), 'Shop.Theme.Actions') . '</a>';
         $this->warning[] = $this->trans('No addresses are available. %s', array($link), 'Shop.Notifications.Success');
     }
     $this->setTemplate('customer/addresses');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:13,代码来源:AddressesController.php

示例12: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = (int) Product::getNewProducts($this->context->language->id, isset($this->p) ? (int) $this->p - 1 : null, isset($this->n) ? (int) $this->n : null, true);
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => Product::getNewProducts($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => (int) $nbProducts, 'homeSize' => Image::getSize('home_default'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'new-products.tpl');
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:13,代码来源:NewProductsController.php

示例13: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $original_query = Tools::getValue('q');
     $query = Tools::replaceAccentedChars(urldecode($original_query));
     if ($this->ajax_search) {
         $searchResults = Search::find((int) Tools::getValue('id_lang'), $query, 1, 10, 'position', 'desc', true);
         if (is_array($searchResults)) {
             foreach ($searchResults as &$product) {
                 $product['product_link'] = $this->context->link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']);
             }
             Hook::exec('actionSearch', array('expr' => $query, 'total' => count($searchResults)));
         }
         $this->ajaxDie(Tools::jsonEncode($searchResults));
     }
     //Only controller content initialization when the user use the normal search
     parent::initContent();
     $product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int) $this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE');
     if ($this->instant_search && !is_array($query)) {
         $this->productSort();
         $this->n = abs((int) Tools::getValue('n', $product_per_page));
         $this->p = abs((int) Tools::getValue('p', 1));
         $search = Search::find($this->context->language->id, $query, 1, 10, 'position', 'desc');
         Hook::exec('actionSearch', array('expr' => $query, 'total' => $search['total']));
         $nbProducts = $search['total'];
         $this->pagination($nbProducts);
         $this->addColorsToProductList($search['result']);
         $this->context->smarty->assign(array('products' => $search['result'], 'search_products' => $search['result'], 'nbProducts' => $search['total'], 'search_query' => $original_query, 'instant_search' => $this->instant_search, 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
     } elseif (($query = Tools::getValue('search_query', Tools::getValue('ref'))) && !is_array($query)) {
         $this->productSort();
         $this->n = abs((int) Tools::getValue('n', $product_per_page));
         $this->p = abs((int) Tools::getValue('p', 1));
         $original_query = $query;
         $query = Tools::replaceAccentedChars(urldecode($query));
         $search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay);
         if (is_array($search['result'])) {
             foreach ($search['result'] as &$product) {
                 $product['link'] .= (strpos($product['link'], '?') === false ? '?' : '&') . 'search_query=' . urlencode($query) . '&results=' . (int) $search['total'];
             }
         }
         Hook::exec('actionSearch', array('expr' => $query, 'total' => $search['total']));
         $nbProducts = $search['total'];
         $this->pagination($nbProducts);
         $this->addColorsToProductList($search['result']);
         $this->context->smarty->assign(array('products' => $search['result'], 'search_products' => $search['result'], 'nbProducts' => $search['total'], 'search_query' => $original_query, 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
     } elseif (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag)) {
         $nbProducts = (int) Search::searchTag($this->context->language->id, $tag, true);
         $this->pagination($nbProducts);
         $result = Search::searchTag($this->context->language->id, $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay);
         Hook::exec('actionSearch', array('expr' => $tag, 'total' => count($result)));
         $this->addColorsToProductList($result);
         $this->context->smarty->assign(array('search_tag' => $tag, 'products' => $result, 'search_products' => $result, 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
     } else {
         $this->context->smarty->assign(array('products' => array(), 'search_products' => array(), 'pages_nb' => 1, 'nbProducts' => 0));
     }
     $this->context->smarty->assign(array('add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'search.tpl');
 }
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:61,代码来源:SearchController.php

示例14: initContent

 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = (int) ProductSale::getNbSales();
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home_default'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:9,代码来源:BestSalesController.php

示例15: initContent

 public function initContent()
 {
     $this->association = Association::getAssociationById($this->idAssociation);
     $this->context->smarty->assign(array('association' => $this->association[0]));
     //pass data to template file
     $this->setTemplate(_PS_THEME_DIR_ . 'association.tpl');
     //call parent initcontent - this is for loading the site's default header, footer, left and right columns
     parent::initContent();
 }
开发者ID:yewed,项目名称:share,代码行数:9,代码来源:AssociationController.php


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