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


PHP Resources::add_scripts方法代码示例

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


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

示例1: action_index

 public function action_index()
 {
     $materialId = $this->request->param('id');
     $materials = new Model_Material('groups');
     //получить содержимое папки
     $data = $materials->getMaterial($materialId);
     $fields = $materials->getFields2($materialId, TRUE);
     $model = array("photos" => array());
     $model["id"] = Arr::get($data, "id");
     $model["name"] = Arr::get($data, "name");
     $model["article"] = Arr::get($data, "art");
     $model["price"] = number_format(Arr::get($fields, 'price'), 0, "", " ");
     Resources::add_scripts(array("js/modules/material/material.js"), get_class());
     // --- Фотки ----------------------------------------------------
     // есть фото
     if (isset($fields["photos"][0])) {
         $photos = $fields["photos"];
         $model["general_photo"] = $photos[0]["value"];
         // Фоток больше 1
         if (count($photos) > 1) {
             foreach ($photos as $photo) {
                 $model["photos"][] = array("original" => $photo["value"], "mini" => Route::url("miniimg2", array("filename" => $photo["value"])));
             }
         }
     } else {
         $model["general_photo"] = "/img/noimg.png";
     }
     // --- /Фотки ----------------------------------------------------
     // --- Коментарии ------------------------------------------------
     echo '<script>window.material_id = JSON.parse(\'' . $materialId . '\');</script>';
     $this->load_module("comments", "/widgets/Comments/index");
     // --- /Коментарии -----------------------------------------------
     $this->set_template("/widgets/material/material.php", "twig")->render($model)->body();
 }
开发者ID:chernogolov,项目名称:blank,代码行数:34,代码来源:Material.php

示例2: action_index

 public function action_index($options = array("items_position_type" => "half"))
 {
     $model = array();
     Resources::add_scripts(array("js/classes/LexCookie.js", "js/modules/item_position/script.js"), get_class());
     Resources::add_styles(array("css/modules/item_position/default.less"), get_class());
     $this->setopt(array("name" => "items_position_type", "description" => "Способ отображения item'ов", "default" => $options["items_position_type"]));
     $model["items_position_type"] = Arr::get($_COOKIE, "items_position_type", $this->getopt("items_position_type"));
     $this->set_template("/widgets/w_item_position.php", "twig")->render($model)->body();
 }
开发者ID:chernogolov,项目名称:blank,代码行数:9,代码来源:ItemPosition.php

示例3: action_index

 public function action_index($options = array())
 {
     Resources::add_scripts(array("js/classes/LexComments.js", "js/modules/comments/comments.js"), get_class());
     Resources::add_styles(array("css/modules/comments/default.less"), get_class());
     $model = array();
     $model["captcha"] = Captcha::instance()->render();
     $model["comments"] = array();
     $model["comments"][] = array("name" => "lexa4ok", "comment" => "test1");
     $model["comments"][] = array("name" => "lexa4ok2", "comment" => "test2");
     $this->set_template("/widgets/comments/default.php", "twig")->render($model)->body();
 }
开发者ID:chernogolov,项目名称:blank,代码行数:11,代码来源:Comments.php

示例4: action_general_dropdown

 public function action_general_dropdown()
 {
     $this->setopt(array("name" => "parent_id", "description" => "Ид каталога", "default" => 4));
     $parent_id = $this->getopt("parent_id");
     $model = array("modules" => array(), "visible" => array(), "menu" => array());
     Resources::add_scripts(array("js/test.js"), get_class());
     Resources::add_styles(array("css/test.less"), get_class());
     $model["modules"]["cart_widget"] = Request::factory('widgets/cart/index')->execute();
     //$model["modules"]["cart"] = Request::factory('widgets/cart/index')->execute();
     $model["visible"]["auth_but"] = false;
     $model["visible"]["registration_but"] = false;
     $create_dropdown = true;
     // Создавать выпадающее меню?
     $uri = Request::detect_uri();
     $page_uri = explode('/', $uri);
     $GLOBALS['uri'] = $page_uri;
     $uri = isset($page_uri[1]) ? $page_uri[1] : '';
     $uri2 = isset($page_uri[2]) ? $page_uri[2] : '';
     $model_tree = new Model_Widgets_Menu('tree');
     $items = array();
     $items[] = array("id" => 0, "level" => 2, "name" => "Главная", "url" => "");
     //Получаем список меню
     $items = array_merge($items, $model_tree->menuItems($parent_id, 2));
     foreach ($items as $key => $mitem) {
         // Добавление пунктов основного меню
         if ($mitem['level'] == 2) {
             $mitem_data = array("href" => '/' . $mitem['url'], "id" => $mitem['id'], "name" => $mitem['name']);
             if ($mitem['url'] == $uri) {
                 $mitem_data["selected"] = " selected";
             }
             // Создавать выпадающее меню?
             if ($create_dropdown) {
                 // Есть дополнительные пункты
                 if (isset($mitem['left_key']) && isset($mitem['right_key'])) {
                     if ($mitem['left_key'] + 1 !== $mitem['right_key']) {
                         $dropdown_items = array();
                         $submenu = $model_tree->menuItems($mitem["id"], 3);
                         foreach ($submenu as $dropdown_item) {
                             $dropdown_items[] = array("href" => '/' . $dropdown_item['parent'] . '/' . $dropdown_item['url'], "name" => $dropdown_item['name'], "id" => $mitem["id"]);
                         }
                         if (count($submenu) !== 0) {
                             $mitem_data["dropdown"] = $dropdown_items;
                         }
                     }
                 }
             }
             $model["menu"][] = $mitem_data;
         }
     }
     $this->set_template("widgets/menu/general_dropdown.php", "twig")->render($model)->body();
 }
开发者ID:chernogolov,项目名称:blank,代码行数:51,代码来源:Menu.php

示例5: action_index

 public function action_index()
 {
     $model = array();
     $counter = 0;
     if (isset($_COOKIE["order_id"])) {
         $orders = new Model_Orders();
         $order_data = $orders->getOrder($_COOKIE["order_id"]);
         if (isset($order_data['items'])) {
             foreach ($order_data['items'] as $item_id => $item) {
                 $counter += $item['cnt'];
             }
         }
         $model['items_count'] = $counter;
     } else {
         $model['items_count'] = 0;
     }
     Resources::add_scripts(array("js/classes/LexFormValidator.js", "js/classes/helpers.js", "js/classes/LexCookie.js", "js/classes/LexCart.js", "js/modules/cart/cart.js"), get_class());
     Resources::add_styles(array("css/modules/cart/default.less"), get_class());
     return $this->set_template('widgets/cart/button.php')->render($model)->body();
 }
开发者ID:chernogolov,项目名称:blank,代码行数:20,代码来源:Cart.php


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