public function index() { View::set('add_item_url', Url::action('add')); View::set('import_items_url', Url::action('import')); View::set('api_url', Url::path('api/' . $this->getWyfPath())); View::set('base_url', Url::action('')); $model = $this->getModel(); $description = $model->getDescription(); $fields = $description->getFields(); $primaryKey = $description->getPrimaryKey()[0]; if (empty($this->listFields)) { foreach ($fields as $field) { if ($field['name'] == $primaryKey) { continue; } $this->listFields[] = ['name' => $field['name'], 'label' => $field['name']]; } } View::set('list_fields', $this->listFields); View::set('operations', $this->operations); View::set('primary_key_field', $primaryKey); View::set('foreign_key', false); }
public static function run() { Session::start(); honam\TemplateEngine::prependPath('views/shared'); honam\TemplateEngine::prependPath('views/layouts'); honam\AssetsLoader::setSiteUrl(Url::path('public')); honam\AssetsLoader::appendSourceDir('assets'); honam\AssetsLoader::setDestinationDir('public'); honam\Helper::setBaseUrl(Url::path('')); self::getRouter()->execute(substr(utils\Input::server('REQUEST_URI'), 1)); }
/** * A shortcut wrapper function around the Ntentan::getUrl method * @param $url */ function u($url) { return \ntentan\controllers\Url::path($url); }