示例#1
0
 public static function import($key)
 {
     $path = ZtPath::getInstance();
     $filePath = $path->getPath($key);
     if ($filePath) {
         return require_once $filePath;
     }
     return false;
 }
示例#2
0
 /**
  * Include another template into current template
  * @return \ZtHtml
  */
 public function load($key)
 {
     $tplFile = $this->_path->getPath($key);
     if ($tplFile) {
         $properties = $this->getProperties();
         extract($properties, EXTR_REFS);
         include $tplFile;
     }
     return $this;
 }
示例#3
0
 /**
  * 
  * @param string $className
  */
 public static function autoloadZtPsr2($className)
 {
     if (substr($className, 0, 1) != 'J') {
         $path = ZtPath::getInstance();
         $filePath = $path->getPathByClassname($className);
         if ($filePath) {
             return require_once $filePath;
         }
     }
     return false;
 }
示例#4
0
 /**
  * Get asset file with relative path
  * @param string $key File location    
  * @return boolean|string
  */
 public function getAssetUrl($key)
 {
     return ZtPath::getInstance()->getUrl($key);
 }