예제 #1
0
파일: Mustache.php 프로젝트: no22/gongo
 public function renderTemplate($context, $filename = null)
 {
     $filename = is_null($filename) ? $this->options->filename : $filename;
     $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.html');
     $template = file_get_contents($filepath);
     return $this->renderer->render($template, $context);
 }
예제 #2
0
파일: Smarty2.php 프로젝트: no22/gongo
 function _compiledTemplatePath()
 {
     if (!$this->path->temp) {
         return false;
     }
     $path = $this->path->temp . Gongo_File_Path::make('/smarty2/templates_c/');
     Gongo_File::makeDir($path);
     return $path;
 }
예제 #3
0
파일: Twig.php 프로젝트: no22/gongo
 function _cachePath()
 {
     if (!$this->path->temp) {
         return false;
     }
     $path = $this->path->temp . Gongo_File_Path::make('/twig/');
     Gongo_File::makeDir($path);
     return $path;
 }
예제 #4
0
 public function renderTemplate($context, $filename = null)
 {
     $filename = is_null($filename) ? $this->options->filename : $filename;
     $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.php');
     extract($context);
     ob_start();
     include $filepath;
     return ob_get_clean();
 }
예제 #5
0
파일: Template.php 프로젝트: no22/gongo
 function cachePath($name = null)
 {
     if (!$this->path->temp) {
         return false;
     }
     $name = is_null($name) ? $this->name : $name;
     $path = $this->path->temp . Gongo_File_Path::make('/' . $name . '/');
     Gongo_File::makeDir($path);
     return $path;
 }
예제 #6
0
파일: Phptal.php 프로젝트: no22/gongo
 public function renderTemplate($context, $filename = null)
 {
     $filename = is_null($filename) ? $this->options->filename : $filename;
     $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.html');
     $this->renderer->setTemplate($filepath);
     foreach ($context as $key => $value) {
         $this->renderer->{$key} = $value;
     }
     return $this->renderer->execute();
 }
예제 #7
0
파일: Phamlp.php 프로젝트: no22/gongo
 public function renderTemplate($context, $filename = null)
 {
     $filename = is_null($filename) ? $this->options->filename : $filename;
     $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.haml');
     $cachepath = Gongo_App::$environment->path->phamlp->cachePath . Gongo_File_Path::make($filename . '.php');
     $this->cache->updateFile($filepath, $cachepath, $this->_compile());
     extract($context);
     ob_start();
     include $cachepath;
     return ob_get_clean();
 }
예제 #8
0
파일: Smarty3.php 프로젝트: no22/gongo
 public function initSmarty($smarty)
 {
     $envpath = Gongo_App::$environment->path;
     if ($this->dirpath()) {
         $smarty->template_dir = Gongo_File_Path::make($this->dirpath());
     } else {
         $smarty->template_dir = $envpath->smarty3->templatePath;
     }
     $smarty->compile_dir = $envpath->smarty3->compiledTemplatePath;
     $smarty->config_dir = $envpath->smarty3->configPath;
     $smarty->cache_dir = $envpath->smarty3->cachePath;
     return $smarty;
 }
예제 #9
0
파일: App.php 프로젝트: no22/gongo
 static function autoload($className)
 {
     $ns = '';
     if (false !== ($lastNsPos = strrpos($className, '\\'))) {
         $ns = Gongo_File_Path::make(strtr(substr($className, $lastNsPos), array('\\' => '/')));
         $className = substr($className, $lastNsPos + 1);
     }
     $filePath = Gongo_File_Path::make('/' . strtr($className, array('_' => '/')) . '.php');
     $paths = self::$environment->autoloadPaths;
     foreach ($paths as $path) {
         if (is_file($path . $ns . $filePath)) {
             require $path . $ns . $filePath;
             return;
         }
     }
 }
예제 #10
0
파일: Dispatcher.php 프로젝트: no22/gongo
 public function makeControllerClassPath($className)
 {
     $appPath = Gongo_App::$environment->path->app;
     return $appPath . Gongo_File_Path::make('/' . strtr($className, array('_' => '/'))) . '.php';
 }
예제 #11
0
파일: Mustache.php 프로젝트: no22/gongo
 function _libraryPath()
 {
     return $this->path->lib . Gongo_File_Path::make('/Mustache/Autoloader.php');
 }
예제 #12
0
파일: Phptal.php 프로젝트: no22/gongo
 function _libraryPath()
 {
     return $this->path->lib . Gongo_File_Path::make('/PHPTAL/PHPTAL.php');
 }
예제 #13
0
파일: Doo.php 프로젝트: no22/gongo
 function _libraryPath()
 {
     return $this->path->lib . Gongo_File_Path::make('/dwoo/dwooAutoload.php');
 }
예제 #14
0
파일: Fammel.php 프로젝트: no22/gongo
 function _libraryPath()
 {
     return $this->path->lib . Gongo_File_Path::make('/Fammel/fammel.php');
 }
예제 #15
0
파일: Path.php 프로젝트: no22/gongo
 function _lib()
 {
     return $this->webapp . Gongo_File_Path::make('/lib');
 }
예제 #16
0
파일: DocumentRoot.php 프로젝트: no22/gongo
 function _img()
 {
     return $this->assets . Gongo_File_Path::make('/img');
 }
예제 #17
0
파일: Phamlp.php 프로젝트: no22/gongo
 function _libraryPath()
 {
     return $this->path->lib . Gongo_File_Path::make('/phamlp/haml/HamlParser.php');
 }
예제 #18
0
파일: Dwoo.php 프로젝트: no22/gongo
 public function renderTemplate($context, $filename = null)
 {
     $filename = is_null($filename) ? $this->options->filename : $filename;
     $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.tpl');
     return $this->renderer->get($filepath, $context);
 }