Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. class Controller_Agentone extends Controller_Sbase {
  4.  
  5.     public function action_index()
  6.     {
  7.         //определяем seo
  8.         $this->template->seo_title='Page Title';
  9.  
  10.         //добавляем массивы стилей и скриптов
  11.         $styles = array(
  12.             'assets/css/global.css'
  13.         );
  14.  
  15.         $scripts = array(
  16.             'assets/css/style.css'
  17.         );
  18.  
  19.         //определяем файлы стилей и скриптов
  20.         $this->template->styles=array_unique(array_merge($this->template->styles,$styles));
  21.         $this->template->scripts=array_unique(array_merge($this->template->scripts,$scripts));
  22.  
  23.         //определяем види для соответствующих блоков
  24.         $block_center = View::factory('agents/v_agent_one');
  25.  
  26.         //сео блоки
  27.         if ($block_center->ag)
  28.         {
  29.             $this->template->seo_title = $block_center->ag['username'].' / '.__($block_center->ag['cat_pref']);
  30.             $this->template->seo_key = $block_center->ag['username'].' / '.__($block_center->ag['cat_pref']);
  31.             $this->template->seo_desc = $block_center->ag['username'].' / '.__($block_center->ag['cat_pref']);
  32.         }
  33.  
  34.         //определяем значения базовых блоков в шаблоне
  35.         $this->template->block_center = array($block_center);
  36.  
  37.     }
  38.    
  39.     // Страница при печати
  40.     public function action_agent_one_print()
  41.     {
  42.         // Определяем види для соответствующих блоков
  43.         $block_center = View::factory('agents/v_agent_one_print');
  44.        
  45.         $block_center->text = 'Этот текст надо перенести на страницу view для распечатки';
  46.        
  47.         //определяем значения базовых блоков в шаблоне
  48.         $this->template->block_center = array($block_center);
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement