本文整理汇总了PHP中Admin::menu方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::menu方法的具体用法?PHP Admin::menu怎么用?PHP Admin::menu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::menu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_provides_root_menu_items
/** @test */
public function it_provides_root_menu_items()
{
Admin::menu('My\\Model');
$items = Admin::instance()->getMenu();
$this->assertCount(2, $items);
$this->assertContainsOnlyInstancesOf('SleepingOwl\\Admin\\Menu\\MenuItem', $items);
}
示例2: it_support_urls
/** @test */
public function it_support_urls()
{
$menu = Admin::menu('MyModel');
$this->assertEquals('http://localhost/admin/my_models', $menu->url());
$menu->url('my-url');
$this->assertEquals('http://localhost/admin/my-url', $menu->url());
$menu->url('http://google.com');
$this->assertEquals('http://google.com', $menu->url());
}
示例3: array
<div class="row">
<?php
Admin::menu(array("/admin/abonements/create" => "Добавить абонемент", "/admin/abonements" => "Управление абонементами"));
?>
<div class="span9">
<h1>Редактировать абонемент</h1>
<div class="form">
<?php
Form::makeForm(array("method" => "post", "attrs" => array("months", "price"), "model_name" => "Abonement"), $model);
?>
</div><!-- form --></div>
</div>
示例4:
<?php
/*
* Describe your menu here.
*
* There is some simple examples what you can use:
*
* Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\AdminController@getIndex');
* Admin::menu(User::class)->icon('fa-user');
* Admin::menu()->label('Menu with subitems')->icon('fa-book')->items(function ()
* {
* Admin::menu(\Foo\Bar::class)->icon('fa-sitemap');
* Admin::menu('\Foo\Baz')->label('Overwrite model title');
* Admin::menu()->url('my-page')->label('My custom page')->uses('\MyController@getMyPage');
* });
*/
Admin::menu()->url('/')->label('Dashboard')->icon('fa-dashboard')->uses('\\App\\Http\\Controllers\\AdminController@getIndex');
Admin::menu(\App\User::class)->icon('fa-user');
Admin::menu(\App\Location::class)->icon('fa-map-marker');
Admin::menu(\App\Day::class)->icon('fa-calendar');
Admin::menu(\App\TimeSlot::class)->icon('fa-clock-o');
Admin::menu(\App\Booth::class)->icon('fa-building');
// Admin::menu()->url('assign')->label('Assign Booths')->uses('\App\Http\Controllers\AdminController@getIndex');
示例5:
<?php
use App\Admin\CategoryController;
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard');
Admin::menu('App\\Category')->label('Категории');
Admin::menu('App\\Product')->label('Товары');
Admin::menu('App\\Order')->label('Заказы');
示例6:
<?php
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard');
//user roles/permissions
Admin::menu()->label('Users')->icon('fa-book')->items(function () {
Admin::menu('Crimibook\\User')->icon('fa-check')->label('Users');
Admin::menu('Crimibook\\Models\\Follow')->icon('fa-check')->label('Follows');
});
Admin::menu('Crimibook\\Models\\Album')->icon('fa-check')->label('Albums');
Admin::menu('Crimibook\\Models\\Status')->icon('fa-check')->label('Status');
示例7: isset
<div class="row">
<?php
Admin::menu(array("/admin/movies/create" => "Добавить фильм", "/admin/movies" => "Управление фильмами"));
?>
<div class="span9">
<h1>Управление фильмами</h1>
<table class="items table">
<thead>
<tr>
<th id="city-grid_c0"><a class="sort-link" href="/admin/movies?sort=id&type=<?php
echo isset($_GET['type']) && $_GET['type'] == 'asc' ? "desc" : "asc";
?>
">ID</a></th>
<th id="city-grid_c1"><a class="sort-link" href="/admin/movies?sort=en_name&type=<?php
echo isset($_GET['type']) && $_GET['type'] == 'asc' ? "desc" : "asc";
?>
">Название</a></th>
<th id="city-grid_c2"><a class="sort-link" href="/admin/movies?sort=type&type=<?php
echo isset($_GET['type']) && $_GET['type'] == 'asc' ? "desc" : "asc";
?>
">Тип</a></th>
<th class="button-column" id="city-grid_c3"> </th></tr>
</thead>
<tbody>
<?php
foreach ($movies as $movie) {
?>
<tr class="<?php
echo $movie->id % 2 == 0 ? 'odd' : 'even';
?>
">
示例8:
<?php
/*
* Describe your menu here.
*
* There is some simple examples what you can use:
*
* Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\AdminController@getIndex');
* Admin::menu(User::class)->icon('fa-user');
* Admin::menu()->label('Menu with subitems')->icon('fa-book')->items(function ()
* {
* Admin::menu(\Foo\Bar::class)->icon('fa-sitemap');
* Admin::menu('\Foo\Baz')->label('Overwrite model title');
* Admin::menu()->url('my-page')->label('My custom page')->uses('\MyController@getMyPage');
* });
*/
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\\SleepingOwl\\Admin\\Controllers\\DummyController@getIndex');
Admin::menu()->url('/')->label('Start Page')->icon('fa-dashboard')->uses('\\App\\HTTP\\Controllers\\AdminController@getIndex');
/*Admin::menu(\App\User::class)->icon('fa-user');
Admin::menu()->label('Subitems')->icon('fa-book')->items(function ()
{
Admin::menu(\Acme\Models\Bar\User::class)->icon('fa-user');
Admin::menu(\Acme\Models\Foo::class)->label('my label');
});*/
示例9:
<?php
/*
* Describe your menu here.
*
* There is some simple examples what you can use:
*
* Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\AdminController@getIndex');
* Admin::menu(User::class)->icon('fa-user');
* Admin::menu()->label('Menu with subitems')->icon('fa-book')->items(function ()
* {
* Admin::menu(\Foo\Bar::class)->icon('fa-sitemap');
* Admin::menu('\Foo\Baz')->label('Overwrite model title');
* Admin::menu()->url('my-page')->label('My custom page')->uses('\MyController@getMyPage');
* });
*/
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\\SleepingOwl\\Admin\\Controllers\\DummyController@getIndex');
Admin::menu(\App\Classification::class)->label('Classification');
Admin::menu(\App\Category::class)->label('Category');
Admin::menu(\App\Uom::class)->label('Unit of Measure');
Admin::menu(\App\Organization::class)->label('Organization');
Admin::menu(\App\Part::class)->label('Part');
Admin::menu(\App\Trade::class)->label('Trade');
Admin::menu(\App\JobType::class)->label('Job Type');
Admin::menu(\App\ObjectType::class)->label('Object Type');
Admin::menu(\App\Status::class)->label('Status');
Admin::menu(\App\Object::class)->label('Object');
Admin::menu(\App\WorkOrder::class)->label('Work Order');
示例10: is_object
<div class="row">
<?php
Admin::menu(array("/admin/series/create" => "Добавить серию", "/admin/series" => "Список серий"));
?>
<div class="span9">
<h1><?php
echo is_object($model) ? "Редактировать" : "Добавить";
?>
серию</h1>
<div class="form">
<div id="hidden" style="display: none; padding-top: 30px;">
<div class="row">
<p>Серия номер 1</p>
</div>
<div class="row"><label for="name" class="required">Название серии <span class="required">*</span></label><input type="text" name="Series[name][]" id="name"></div><div class="row"><label for="url" class="required">Ссылка на видео <span class="required">*</span></label><input type="text" name="Series[url][]" id="url"></div><div class="row"><label for="en_sub" class="required">Английские субтитры <span class="required">*</span></label><input name="en_sub[]" type="file" id="en_sub"></div><div class="row"><label for="ru_sub" class="required">Русские субтитры <span class="required">*</span></label><input name="ru_sub[]" type="file" id="ru_sub"></div><div class="row"><label for="sort" class="required">Номер серии <span class="required">*</span></label><input type="text" name="Series[sort][]" id="sort"></div>
</div>
<form method="post" enctype="multipart/form-data">
<p class="note">Поля с <span class="required">*</span> обязательны для заполнения.</p>
<div class="row"><p>Серия номер 1</p></div>
<div class="row"><label for="name" class="required">Название серии <span class="required">*</span></label><input type="text" name="Series[name][]" id="name"></div><div class="row"><label for="url" class="required">Ссылка на видео <span class="required">*</span></label><input type="text" name="Series[url][]" id="url"></div><div class="row"><label for="en_sub" class="required">Английские субтитры <span class="required">*</span></label><input name="en_sub[]" type="file" id="en_sub"></div><div class="row"><label for="ru_sub" class="required">Русские субтитры <span class="required">*</span></label><input name="ru_sub[]" type="file" id="ru_sub"></div><div class="row"><label for="sort" class="required">Номер серии <span class="required">*</span></label><input type="text" name="Series[sort][]" id="sort"></div><div id="dop_seris"></div><div class="row buttons"><input type="submit" name="yt0" value="Сохранить"></div></form>
<button type="button" id="clickMe">Добавить серию</button>
<script>
var i = 2;
$('#clickMe').on("click", function() {
var element = $('#hidden').clone().show();
element.attr("id", "");
element.children(".row").children("p").html("Серия номер "+i);
i+=1;
element.appendTo('#dop_seris');
});
示例11: _e
<span class="icon-bar"></span>
</a>
<a class="brand" href="<?php
echo TH_PUB_ROOT;
?>
" rel="tooltip" title='<?php
_e('admin', 'view-pub-site');
?>
' target='_blank'>
<?php
echo Settings::get('site', 'site name', true);
?>
</a>
<div class="nav-collapse">
<?php
echo Admin::menu();
?>
<ul class="nav pull-right">
<li class="dropdown">
<?php
$editLink = Admin::link('users/edit-user', array('id' => Users::currentUser()->getId()));
?>
<a href="<?php
echo $editLink;
?>
" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-user icon-white"></i>
<?php
echo Users::currentUser()->getName();
?>
<b class="caret"></b>
示例12:
<?php
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard');
Admin::menu('App\\Models\\License')->icon('fa-key');
Admin::menu()->label('Users')->icon('fa-users')->items(function () {
Admin::menu('App\\Models\\Organization')->icon('fa-sitemap');
Admin::menu('App\\Models\\Member')->icon('fa-user');
Admin::menu('App\\Models\\Sector')->icon('fa-puzzle-piece');
Admin::menu('App\\Models\\Country')->icon('fa-flag');
});
Admin::menu()->label('Test results')->icon('fa-cogs')->items(function () {
Admin::menu('App\\Models\\Evaluation')->icon('fa-desktop');
Admin::menu('App\\Models\\Webpage')->icon('fa-globe');
Admin::menu('App\\Models\\Result')->icon('fa-legal');
});
Admin::menu('SleepingOwl\\AdminAuth\\Entities\\Administrator')->icon('fa-user');
示例13:
* Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\AdminController@getIndex');
* Admin::menu(User::class)->icon('fa-user');
* Admin::menu()->label('Menu with subitems')->icon('fa-book')->items(function ()
* {
* Admin::menu(\Foo\Bar::class)->icon('fa-sitemap');
* Admin::menu('\Foo\Baz')->label('Overwrite model title');
* Admin::menu()->url('my-page')->label('My custom page')->uses('\MyController@getMyPage');
* });
*/
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\\SleepingOwl\\Admin\\Controllers\\DummyController@getIndex');
///Admin::menu()->url('sliders')->label('Slider')->icon('fa-film')->uses('\App\HTTP\Controllers\SliderController@index');
/// Slider menu - submenu
Admin::menu()->label('Slider')->icon('fa-film')->items(function () {
Admin::menu()->url('sliders')->label('Indice')->icon('fa-list-ul')->uses('\\App\\Http\\Controllers\\SliderController@index');
Admin::menu()->url('sliders/add')->label('Aggiungi')->icon('fa-file-o')->uses('\\App\\Http\\Controllers\\SliderController@create');
//Admin::menu()->url('sliders/{id}')->label('show')->icon('fa-file-o')->uses('\App\HTTP\Controllers\SliderController@show');
});
/// Teams - Menu
Admin::menu()->label('Team Members')->icon('fa-male')->items(function () {
Admin::menu()->url('teams')->label('Indice')->icon('fa-list-ul')->uses('\\App\\Http\\Controllers\\TeamController@index');
Admin::menu()->url('teams/add')->label('Aggiungi')->icon('fa-file-o')->uses('\\App\\Http\\Controllers\\TeamController@create');
//Admin::menu()->url('sliders/{id}')->label('show')->icon('fa-file-o')->uses('\App\HTTP\Controllers\SliderController@show');
});
/// Holidays - Menu
Admin::menu()->label('Holidays')->icon('fa-plane')->items(function () {
Admin::menu()->url('holidays')->label('Indice')->icon('fa-list-ul')->uses('\\App\\Http\\Controllers\\HolidayController@index');
Admin::menu()->url('holidays/add')->label('Aggiungi')->icon('fa-file-o')->uses('\\App\\Http\\Controllers\\HolidayController@create');
});
Admin::menu(\App\Category::class)->icon('fa-list');
Admin::menu(\App\Holiday::class)->icon('fa-list');
示例14:
<?php
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard');
Admin::menu('App\\User')->icon('fa-users');
Admin::menu('App\\Product')->icon('fa-list');
Admin::menu('App\\UserProduct')->icon('fa-list');
Admin::menu('App\\Feedback')->icon('fa-rss');
Admin::menu('App\\Setting')->icon('fa-folder-open');
Admin::menu()->url('send_products')->label('Раздача товаров');
示例15:
<?php
/*
* Describe your menu here.
*
* There is some simple examples what you can use:
*
* Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\AdminController@getIndex');
* Admin::menu(User::class)->icon('fa-user');
* Admin::menu()->label('Menu with subitems')->icon('fa-book')->items(function ()
* {
* Admin::menu(\Foo\Bar::class)->icon('fa-sitemap');
* Admin::menu('\Foo\Baz')->label('Overwrite model title');
* Admin::menu()->url('my-page')->label('My custom page')->uses('\MyController@getMyPage');
* });
*/
Admin::menu()->url('/')->label('Start page')->icon('fa-dashboard')->uses('\\SleepingOwl\\Admin\\Controllers\\DummyController@getIndex');
Admin::menu(\App\User::class)->icon('fa-user');