當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Backend::getPathPrefix方法代碼示例

本文整理匯總了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' => 'Добавить пользователя'));
 }
開發者ID:doberbeatz,項目名稱:backend,代碼行數:15,代碼來源:BackendUsers.php

示例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));
開發者ID:doberbeatz,項目名稱:backend,代碼行數:8,代碼來源:navigation.php

示例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');
    }));
});
開發者ID:doberbeatz,項目名稱:backend,代碼行數:30,代碼來源:routes.php


注:本文中的Backend::getPathPrefix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。