gy-doc-code
[ class tree: gy-doc-code ] [ index: gy-doc-code ] [ all elements ]

Source for file Controller.php

Documentation is available at Controller.php

  1. <?php 
  2. namespace Gy\Core\Component\Mvc;
  3.  
  4. use Gy\Core\Lang;
  5.  
  6. if (!defined("GY_CORE") && (GY_CORE !== true)) die( "gy: err include core" );
  7.  
  8. class Controller
  9. {
  10.     public $model;
  11.     public $controller; // ссылка для запуска выбранного контроллера компонента
  12.     public $lang;
  13.     public $template; // объект шаблона
  14.     public $arParam;
  15.  
  16.     public function __construct($url, $lang)
  17.     {
  18.         $this->controller = $url.'/controller.php';
  19.         $this->lang = new Lang($url, 'controller', $lang);
  20.     }
  21.  
  22.     /**
  23.      * setModel
  24.      * @param type $model 
  25.      */
  26.     public function setModel($model)
  27.     { // установить ссылку на модель если есть
  28.         $this->model = $model;
  29.     }
  30.  
  31.     /**
  32.      * setTemplate - задать шаблон
  33.      * @param object class template $template
  34.      */
  35.     public function setTemplate($template)
  36.     {  
  37.         $this->template = $template;    
  38.     }
  39.  
  40.     /**
  41.      * setArParam - задать параметры компонента // set array property component
  42.      * @param type $arParam 
  43.      */
  44.     public function setArParam($arParam)
  45.     { 
  46.         $this->arParam = $arParam;
  47.     }
  48.  
  49.     /**
  50.      * run
  51.      */
  52.     public function run()
  53.     {
  54.         $arRes = array();
  55.         include $this->controller;
  56.     }
  57.  
  58. }

Documentation generated on Sat, 27 Apr 2024 11:17:29 +0300 by phpDocumentor 1.4.3