Esempio n. 1
0
 public function action_index()
 {
     $materials = new Model_Material('group');
     $gid = $this->request->param('id');
     $template = $this->request->param('template');
     if ($template) {
         $this->template = View::factory('widgets/' . $template);
     }
     //смотрим шаблон для виджета
     $widget = new Model_Widget();
     $template = $widget->getTempalte('top', $gid);
     if ($template) {
         $this->template = View::factory('widgets/' . $template);
     }
     $data = $materials->getRandomMaterials($gid, 4, time());
     $this->template->data = $data;
 }