Exemple #1
0
 private function _genView($controller, $action, $engine, $directory)
 {
     $view = new Greut();
     $directory = $directory . ucfirst($controller) . '/';
     $file = $directory . ucfirst($action) . '.tpl.php';
     $data = $view->getData();
     $tpl = realpath(__DIR__ . '/../../Template/');
     $data->controller = $controller;
     $data->action = $action;
     $this->dir($directory);
     if ($tpl === false) {
         throw new \Hoa\Core\Exception\Exception('Template directory not found !', 1);
     }
     if (is_dir($tpl . '/' . ucfirst($engine)) === false) {
         throw new \Hoa\Core\Exception\Exception('This engine template (%s) has not support yet !', 2, array($engine));
     }
     $this->_file($file, '' . "\n " . $view->renderFile($tpl . '/' . ucfirst($engine) . '/View.tpl.php'));
     // ?
 }
Exemple #2
0
 protected function generateModel($resource, $action, $directory)
 {
     $view = new Greut();
     $file = $directory . ucfirst($resource) . '.php';
     $data = $view->getData();
     $tpl = realpath(__DIR__ . '/../../Template/');
     $data->resource = $resource;
     $data->action = $action;
     if ($tpl === false) {
         throw new \Hoa\Core\Exception\Exception('Template directory not found !', 1);
     }
     $this->_file($file, '<?php' . "\n" . $view->renderFile($tpl . '/Model.tpl.php'));
     // ?
 }