Exemple #1
0
 public static function Instance()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #2
0
 public function action_search()
 {
     $this->title .= '->Поиск';
     $this->breadCrambsActive = 'Поиск';
     $templates = array();
     $error = true;
     if ($this->isPost()) {
         $mSearch = M_Search::Instance();
         $result = $mSearch->find($_POST['search']);
         foreach ($result as $key => $value) {
             if (count($value) > 0) {
                 // Получение пути к шаблону
                 $templateItem = $this->getTemplate('components/page/' . $mSearch->get_template($key));
                 $templates[] = $this->Template($templateItem, array('records' => $value));
             }
         }
         $error = false;
     }
     // Получение пути к шаблону
     $templateName = $this->getTemplate('components/page/search/v_search.php');
     $this->blocks['_content_page'] = $this->Template($templateName, array('templates' => $templates));
 }