Esempio n. 1
0
 public function action_index()
 {
     // $this->response->body('Welcome');
     $varhome = Smarty_View::factory('home.tpl');
     $varhome->body2 = 'Variable content';
     $varhome->body = Smarty_View::factory('formLogin.tpl');
     $varhome->table = $this->load_table();
     $this->response->body($varhome->render());
 }
Esempio n. 2
0
 /**
  * Returns a new View object. If you do not define the "file" parameter,
  * you must call [View::set_filename].
  *
  *     $view = View::factory($file);
  *
  * @param   string  view filename
  * @param   array   array of values
  * @return  View
  */
 public static function factory($file = NULL, array $data = NULL)
 {
     if (self::is_smarty_template($file)) {
         // backwards compatibility - translate smarty:template to template.tpl
         if (substr($file, 0, 7) == 'smarty:') {
             if (strlen($file) == 7) {
                 $file = NULL;
             } else {
                 $file = substr($file, 7) . '.tpl';
             }
         }
         return Smarty_View::factory($file, $data);
     } else {
         return parent::factory($file, $data);
     }
 }
Esempio n. 3
0
 public function action_index()
 {
     $var_myhome = Smarty_View::factory('myhome.tpl');
     $this->response->body($var_myhome->render());
 }