本文整理汇总了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();
示例2:
function __construct()
{
parent::__construct();
$this->catalog = $this->get_catalog();
$this->brand = $this->get_brands();
parent::template('sliders_main');
}
示例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');
}
示例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;
}
示例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');
}
示例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;
}
示例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"));
}
}
示例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"))));
});