예제 #1
0
 public static function factory()
 {
     $class = get_called_class();
     $args = [];
     if (extension::has($class . '_CLASS')) {
         $class = extension::get($class . '_CLASS');
     }
     if (func_num_args()) {
         $args = func_get_args();
     }
     $reflect = new ReflectionClass($class);
     return $reflect->newInstanceArgs($args);
 }
예제 #2
0
파일: url.php 프로젝트: pasterntt/dynao-CMS
 public static function fe($id = '', $params = [])
 {
     if ($id == '') {
         type::super('page_id', 'int', dyn::get('start_page'));
     }
     $url = extension::get('URL_REWRITE', ['id' => $id, 'params' => $params]);
     if (!extension::has('URL_REWRITE')) {
         $url = 'index.php?page_id=' . $id;
         foreach ($params as $name => $value) {
             $url .= '&' . $name . '=' . $value;
         }
     }
     return $url;
 }