Пример #1
0
/**
 * A shortcut wrapper function around the Ntentan::getUrl method
 * @param $url
 */
function u($url)
{
    return \ntentan\controllers\Url::path($url);
}
Пример #2
0
 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));
 }
Пример #3
0
 public function delete($id, $confirm = null)
 {
     $model = $this->getModel();
     $primaryKey = $model->getDescription()->getPrimaryKey()[0];
     $item = $model->fetchFirst([$primaryKey => $id]);
     if ($confirm == 'yes') {
         $item->delete();
         return Redirect::action('');
     } else {
         View::set('item', $item);
         View::set('delete_yes_url', Url::action("delete/{$id}", ['confirm' => 'yes']));
         View::set('delete_no_url', Url::action(''));
     }
 }