Ejemplo n.º 1
0
 private function generatePhpHelper()
 {
     $routesPhpHelperPath = Path::join(ROOT_PATH, ApplicationPaths::getHelperPath(), 'GeneratedUriHelper.php');
     if (UriHelperGenerator::generate()->saveToFile($routesPhpHelperPath) !== false) {
         $this->_output->writeln("File with PHP uri helpers is generated in <info>{$routesPhpHelperPath}</info>");
     }
 }
Ejemplo n.º 2
0
 public function renderLayout()
 {
     if ($this->_layout) {
         $layoutPath = Path::join(ROOT_PATH, ApplicationPaths::getLayoutPath(), $this->_layout . '.phtml');
         /** @noinspection PhpIncludeInspection */
         require_once $layoutPath;
     }
 }
Ejemplo n.º 3
0
 public function __construct($viewName, array $attributes)
 {
     $this->_viewName = $viewName;
     $this->_attributes = $attributes;
     $this->_loaderPath = Path::join(ROOT_PATH, ApplicationPaths::getViewPath());
     $this->_viewFilename = $viewName . self::EXTENSION;
     $this->_viewPath = Path::join($this->_loaderPath, $this->_viewFilename);
 }
Ejemplo n.º 4
0
 private function _loadHelpers()
 {
     $viewHelperPath = Path::join('Helper', 'ViewHelper.php');
     $appHelperPath = Path::join(ROOT_PATH, ApplicationPaths::getHelperPath(), 'ApplicationHelper.php');
     $formHelperPath = Path::join('Helper', 'FormHelper.php');
     $urlHelperPath = Path::join(ROOT_PATH, ApplicationPaths::getHelperPath(), 'UrlHelper.php');
     $this->_requireOnce($viewHelperPath);
     Files::loadIfExists($appHelperPath);
     $this->_requireOnce($formHelperPath);
     Files::loadIfExists($urlHelperPath);
 }
Ejemplo n.º 5
0
 private function _loadViewHelper()
 {
     $helperPath = Path::join(ROOT_PATH, ApplicationPaths::getViewPath(), $this->_viewName . '.helper.php');
     Files::loadIfExists($helperPath);
 }
Ejemplo n.º 6
0
 public static function resolveViewPath($name, $responseType)
 {
     return Path::join(ROOT_PATH, ApplicationPaths::getViewPath(), $name . self::getViewPostfix($responseType));
 }