当前位置: 首页>>代码示例>>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;未经允许,请勿转载。