本文整理汇总了PHP中Admin::view方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::view方法的具体用法?PHP Admin::view怎么用?PHP Admin::view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::view方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_renders_view_within_admin_layout
/** @test */
public function it_renders_view_within_admin_layout()
{
$view = Admin::view('my-content', 'my-title');
$data = $view->getData();
$this->assertArrayHasKey('content', $data);
$this->assertEquals('my-content', $data['content']);
$this->assertArrayHasKey('title', $data);
$this->assertEquals('my-title', $data['title']);
}
示例2: function
<?php
Route::get('/', function () {
$content = view('dashboard');
return Admin::view($content, 'Dashboard');
});
Route::get('/template/{template}', ['as' => 'admin.change-template', function ($template) {
if ($template == 0) {
$cookie = cookie('admin-template', $template, -1);
} else {
$cookie = cookie('admin-template', $template);
}
return back()->withCookie($cookie);
}]);
Route::get('/about', function () {
$content = view('about');
return Admin::view($content, 'About');
});
Route::get('/my-form', '\\App\\Http\\Controllers\\MyController@getForm');
Route::post('/my-form', ['as' => 'my-form.post', 'uses' => '\\App\\Http\\Controllers\\MyController@postForm']);
Route::get('/model-display', function () {
$display = Admin::model('App\\Page')->display();
$display2 = Admin::model('App\\News')->display();
$display3 = Admin::model('App\\News3')->display();
$content = view('model_display', compact('display', 'display2', 'display3'));
return Admin::view($content, 'Model Display');
});
示例3: function
<?php
AdminRouter::get('', ['as' => 'admin.home', function () {
$content = 'Define your dashboard here.';
return Admin::view($content, 'Dashboard');
}]);
AdminRouter::get('', ['as' => 'admin.user', function () {
$content = AdminAuth::user()->name;
return Admin::view($content, 'Admin');
}]);
//Смена шаблона админки(сейчас не работает надо исправлять шаблоны blade в admin-lte.template)
AdminRouter::get('/template/{template}', ['as' => 'admin.change-template', function ($template) {
if ($template == 0) {
$cookie = cookie('admin-template', $template, -1);
} else {
$cookie = cookie('admin-template', $template);
}
return back()->withCookie($cookie);
}]);
AdminRouter::post('group', ['as' => 'group', 'uses' => '\\App\\Http\\Controllers\\ProcessController@getUsers']);
示例4: function
<?php
Route::get('', ['as' => 'admin.home', function () {
$content = 'Define your dashboard here.';
return Admin::view($content, 'Dashboard');
}]);
示例5: function
<?php
Route::get('', ['as' => 'admin.home', function () {
$orders = \App\Models\Order::all()->where('status', 2);
$count = 0;
foreach ($orders as $order) {
$count = $count + $order->sum;
}
return Admin::view(view('admin.dashboard', compact(['count', 'orders'])), 'Панель администратора');
}]);
示例6: getEdit
public function getEdit($id)
{
$model = $this->model;
/**
* Share SQL data
*/
View::share('row', $model::find($id));
// exit('ssssss');
return Admin::view();
}
示例7: get
<?php
get('', ['as' => 'admin.home', function () {
$content = 'Админ панель магазина на Laravel 5.1.';
return Admin::view($content, 'Админпанель');
}]);
get('order_content/{id}', ['uses' => '\\App\\Http\\Controllers\\OrderController@showOrderContent']);
示例8: function
<?php
Route::get('/admin/elfinder', function () {
$dir = 'packages/barryvdh/elfinder';
$locale = config('app.locale');
$csrf = csrf_token();
$content = View('suroviy.soa_addon::admin.elfinder', compact('dir', 'locale', 'csrf'));
return Admin::view($content, 'Files system');
});