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); }
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; }