本文整理汇总了PHP中app\Language::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::lists方法的具体用法?PHP Language::lists怎么用?PHP Language::lists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Language
的用法示例。
在下文中一共展示了Language::lists方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit(Employee $employee, Emplang $language)
{
$lang = ['0' => 'Select'] + Language::lists('name', 'id')->toArray();
return view('backend.employees.language.edit', compact('employee', 'lang', 'language'));
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit(Photo $photo)
{
$languages = Language::lists('name', 'id')->toArray();
$photoalbums = PhotoAlbum::lists('name', 'id')->toArray();
return view('admin.photo.create_edit', compact('photo', 'languages', 'photoalbums'));
}
示例3: getSelectList
/**
* Get select list for languages
*
* @return mixed
*/
protected function getSelectList()
{
return Language::lists('title', 'id')->all();
}
示例4: edit
/**
* Show the form for editing the specified page.
*
* @param Page $page
* @param FormBuilder $formBuilder
* @return Response
*/
public function edit(Page $page, FormBuilder $formBuilder)
{
$languages = Language::lists('title', 'id')->all();
$form = $formBuilder->create('App\\Forms\\PagesForm', ['method' => 'PATCH', 'url' => route('admin.page.update', ['id' => $page->id]), 'model' => $page], $languages);
return view('admin.pages.edit', compact('form', 'page'));
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit(ArticleCategory $articlecategory)
{
$languages = Language::lists('name', 'id')->toArray();
return view('admin.articlecategory.create_edit', compact('articlecategory', 'languages'));
}
开发者ID:coralhust,项目名称:Laravel-5-Bootstrap-3-Starter-Site,代码行数:11,代码来源:ArticleCategoriesController.php
示例6: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$question = Question::findOrFail($id);
if (!$question->canEdit()) {
abort('403', 'Not authorized.');
}
$languages = Language::lists('name', 'id');
return view('questions.edit', ['question' => $question, 'languages' => $languages]);
}
示例7: edit
/**
* Show the form for editing the specified category.
*
* @param Category $category
* @param FormBuilder $formBuilder
* @return Response
*/
public function edit(Category $category, FormBuilder $formBuilder)
{
$languages = Language::lists('title', 'id')->all();
$form = $formBuilder->create('App\\Forms\\CategoriesForm', ['method' => 'PATCH', 'url' => route('admin.category.update', ['id' => $category->id]), 'model' => $category], $languages);
return view('admin.categories.edit', compact('form', 'category'));
}
示例8: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
// Currencies
view()->composer(array('customers.edit', 'customer_invoices.create', 'companies.edit', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('currencyList', \App\Currency::lists('name', 'id'));
});
// Customer Groups
view()->composer(array('customers.edit'), function ($view) {
$view->with('customer_groupList', \App\CustomerGroup::lists('name', 'id'));
});
// Payment Methods
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('payment_methodList', \App\PaymentMethod::lists('name', 'id'));
});
// Sequences
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('sequenceList', \App\Sequence::lists('name', 'id'));
});
// Invoice Template
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('customerinvoicetemplateList', \App\Template::where('model_name', '=', 'CustomerInvoice')->lists('name', 'id'));
});
// Carriers
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('carrierList', \App\Carrier::lists('name', 'id'));
});
// Sales Representatives
view()->composer(array('customers.edit', 'customer_invoices.create'), function ($view) {
$view->with('salesrepList', \App\SalesRep::select(DB::raw('concat (firstname," ",lastname) as name, id'))->lists('name', 'id'));
});
// Price Lists
view()->composer(array('customers.edit', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('price_listList', \App\PriceList::lists('name', 'id'));
});
// Warehouses
view()->composer(array('products.create', 'stock_movements.create', 'configurationkeys.key_group_2', 'customer_invoices.create'), function ($view) {
$whList = \App\Warehouse::with('address')->get();
$list = [];
foreach ($whList as $wh) {
$list[$wh->id] = $wh->address->alias;
}
$view->with('warehouseList', $list);
// $view->with('warehouseList', \App\Warehouse::lists('name', 'id'));
});
// Taxes
view()->composer(array('customer_invoices.create', 'products.create', 'products.edit'), function ($view) {
$view->with('taxList', \App\Tax::orderby('percent', 'desc')->lists('name', 'id'));
});
view()->composer(array('products.create', 'products.edit', 'customer_invoices.create'), function ($view) {
$view->with('taxpercentList', \App\Tax::lists('percent', 'id'));
});
// Languages
view()->composer(array('users.create', 'users.edit'), function ($view) {
$view->with('languageList', \App\Language::lists('name', 'id'));
});
// Categories
view()->composer(array('products.create', 'products._panel_main_data'), function ($view) {
$view->with('categoryList', \App\Category::orderby('name', 'asc')->lists('name', 'id'));
});
// Stock Movement Types
view()->composer(array('stock_movements.index', 'stock_movements.create'), function ($view) {
$view->with('movement_typeList', \App\StockMovement::stockmovementList());
});
}
示例9: index
/**
* Display form configure system
*
* @return Response
*/
public function index()
{
$configures = Configure::lists('value', 'name');
$languages = Language::lists('language_name', 'code');
return view('configures.configure', compact('configures', 'languages'));
}