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


PHP Module::template方法代码示例

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


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

示例1: get_category

     $this->title = $str;
     $this->category = $str;
     App::$id = $str;
     $this->categories = $this->get_category($str);
 }
 /**
  * @param $cat
  * @return array
  */
 private function get_category($cat)
 {
     $result = App::$db->query("\r                                        SELECT *\r                                        FROM categories\r                                        WHERE title = '{$cat}'\r                                    ");
     if ($result->columnCount() != 0) {
         $result->setFetchMode(PDO::FETCH_ASSOC);
         while ($category = $result->fetch()) {
             $arr[] = $category;
         }
         /** @var Category $arr */
         foreach ($arr as $cat) {
             $this->id = $cat['id'];
             if ($cat['parent_id'] == 0) {
                 $category_arr = $this->add_category($cat['id']);
                 $this->sale = $this->get_sale();
                 parent::template('p_category');
             } else {
                 $category_arr = $this->add_category($cat['parent_id'] <= 3 ? $cat['id'] : $cat['parent_id']);
                 $this->product = $this->get_product($cat['id']);
                 $this->price = $this->get_categoryPriceSort($cat['id']);
                 $this->brands = $this->get_categoryBrandSort();
开发者ID:kovvy,项目名称:shop,代码行数:29,代码来源:Category.class.php

示例2:

 function __construct()
 {
     parent::__construct();
     $this->catalog = $this->get_catalog();
     $this->brand = $this->get_brands();
     parent::template('sliders_main');
 }
开发者ID:kovvy,项目名称:shop,代码行数:7,代码来源:Main.class.php

示例3:

 function __construct($str)
 {
     parent::__construct();
     if (App::POST('button_buy')) {
         $this->go_toPay(App::POST('button_buy'));
     }
     $this->search = $str;
     $this->product = $this->get_product($str);
     parent::template('search');
 }
开发者ID:kovvy,项目名称:shop,代码行数:10,代码来源:Search.class.php

示例4: get_brandProduct

 private function get_brandProduct($id)
 {
     $result = App::$db->query("\n\t\t\t\tSELECT * FROM product WHERE id_brand = '" . $id . "'\n\t\t\t");
     if ($result->rowCount() != 0) {
         $result->setFetchMode(PDO::FETCH_ASSOC);
         while ($brand = $result->fetch()) {
             $product[] = $brand;
         }
         parent::template('brands');
     }
     /** @var Brands $product */
     return $product;
 }
开发者ID:kovvy,项目名称:shop,代码行数:13,代码来源:Brands.class.php

示例5:

 function __construct($str)
 {
     parent::__construct();
     if (empty($str) or !is_numeric($str)) {
         parent::page_404();
     }
     if (App::POST('button_buy')) {
         $this->go_toPay(App::POST('button_buy'));
     }
     if (App::POST('button buy_credit')) {
         $this->go_toPay(App::POST('button buy_credit'));
     }
     $this->sendMessage(App::POST('comment_item_id'), App::POST('comment_author'), App::POST('comment_text'));
     $this->product = $this->get_product($str);
     $this->sale = $this->get_sale();
     parent::template('product');
 }
开发者ID:kovvy,项目名称:shop,代码行数:17,代码来源:Product.class.php

示例6: get_Product

 /**
  * @return array
  */
 private function get_Product()
 {
     if (!empty($_COOKIE['Cookie'])) {
         foreach ($_COOKIE['Cookie'] as $name => $value) {
             $value = htmlspecialchars($value);
             $sql = App::$db->query("\n                                          SELECT id, title, price_g, price_d, img\n                                          FROM product\n                                          WHERE id = '" . $value . "'\n                                          ");
             $sql->setFetchMode(PDO::FETCH_ASSOC);
             if ($sql->rowCount() != 0) {
                 for ($i = 0; $i < $sql->rowCount(); $i++) {
                     $row = $sql->fetch();
                     $product[] = $row;
                 }
             }
         }
         parent::template('basket');
     } else {
         parent::template('no_basket');
     }
     /** @var Basket $product */
     return $product;
 }
开发者ID:kovvy,项目名称:shop,代码行数:24,代码来源:Basket.class.php

示例7: updating

 public function updating($model)
 {
     if ($model->isDirty('status') && $model->status == 1) {
         Mail::send(array("body" => Module::template('signup-approved')->compile(array("BASE_URL" => AppConfig::get("retrieve.email.url"))), "subject" => "Approved!", "to" => $model->email, "from" => "somebody@example.com"));
     }
 }
开发者ID:cbsistem,项目名称:js2php,代码行数:6,代码来源:class.php

示例8: function

<?php

Module\Http\Router::get('/send', function () {
    return $this->json(array("success" => Mail::send(array("body" => Module::template('signup-confirmation')->compile(array("base_url" => AppConfig::get("retrieve.email.url"))), "subject" => "Sign-up confirmation", "to" => $model->email, "from" => "somebody@example.com"))));
});
开发者ID:cbsistem,项目名称:js2php,代码行数:5,代码来源:static_call.php


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