本文整理汇总了PHP中Backend::getPathPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::getPathPrefix方法的具体用法?PHP Backend::getPathPrefix怎么用?PHP Backend::getPathPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend
的用法示例。
在下文中一共展示了Backend::getPathPrefix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// Оформление
$this->setClass('primary');
// Общие данные
$this->addColumn("login", "text", array("label" => "Логин"));
$this->addColumn("name", "text", array("label" => "Имя"));
$this->addColumn("email", "text", array("label" => "Email"));
$this->addColumn('is_active', "ajaxToggler", array("label" => "Активный", "action" => array("route" => Backend::getPathPrefix() . ".users.ajaxUpdate", "params" => array("id" => "{backend_user_id}"))));
// Действия над пользователем
$this->addColumn("edit", "icon", array("icon" => "edit", "link" => array("route" => Backend::getPathPrefix() . ".users.edit", "params" => array("id" => "{backend_user_id}"))));
$this->addColumn("delete", "icon", array("icon" => "times", "method" => "delete", "class" => "js-confirm", "link" => array("route" => Backend::getPathPrefix() . ".users.destroy", "params" => array("id" => "{backend_user_id}"))));
// Действия над пользователями
$this->addAction("add", array("icon" => "plus", "link" => array("route" => \Backend::getPathPrefix() . '.users.create'), 'label' => 'Добавить пользователя'));
}
示例2: array
<?php
// Сбоку
Navigation::getSection('Sidebar')->addItem('MAIN', '/' . \Backend::getPathPrefix(), array('label' => 'Главная', 'icon' => 'dashboard', 'order' => 1));
Navigation::getSection('Sidebar')->addItem('BACKEND_USERS', array(\Backend::getPathPrefix() . '.backend_users.index', array()), array('label' => 'Администраторы', 'icon' => 'user', 'order' => 2));
// Меню наверху
Navigation::getSection('Topbar')->addItem('MAINPAGE', '/', array('label' => 'Перейти на сайт', 'order' => 1));
Navigation::getSection('Topbar')->addItem('SETTINGS', \Backend::getPathPrefix(), array('label' => 'Общие настройки', 'order' => 2));
示例3: array
/**
* Админка
*/
Route::group(['prefix' => \Backend::getPathPrefix(), 'namespace' => 'Doberbeatz\\Laraback', 'before' => array('backend.auth')], function () {
Route::get('/', ['as' => \Backend::getPathPrefix() . '.main', 'uses' => 'BackendController@index']);
/** Администраторы **/
Route::get('backend_users/ajaxUpdate', array('as' => \Backend::getPathPrefix() . '.backend_users.ajaxUpdate', 'uses' => 'BackendUsersController@ajaxUpdate'));
Route::resource('backend_users', "BackendUsersController");
});
/**
* Авторизация
*/
Route::group(['prefix' => \Backend::getPathPrefix(), 'namespace' => 'Doberbeatz\\Laraback\\Controllers'], function () {
/** Форма логина **/
Route::get('login', "AuthController@index");
/** Авторизация **/
Route::post('login', array('before' => 'backend.auth.config', "as" => \Backend::getPathPrefix() . "/login", function () {
$userdata = array('login' => Input::get('login'), 'password' => Input::get('password'), 'is_active' => 1);
if (BackendAuth::attempt($userdata)) {
return Redirect::to(\Backend::getPathPrefix());
} else {
return Redirect::to(\Backend::getPathPrefix() . '/login')->with('login_errors', true);
}
}));
/** Выход **/
Route::get('logout', array("as" => \Backend::getPathPrefix() . "/logout", function () {
BackendAuth::logout();
return Redirect::to(\Backend::getPathPrefix() . '/login');
}));
});