本文整理匯總了PHP中item::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP item::all方法的具體用法?PHP item::all怎麽用?PHP item::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類item
的用法示例。
在下文中一共展示了item::all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
Route::get('login', array('as' => 'login', 'uses' => 'UsersController@login'))->before('guest');
Route::post('login', array('as' => 'login', 'uses' => 'UsersController@handleLogin'));
Route::get('/profile', array('as' => 'profile', 'uses' => 'UsersController@profile'))->before('auth');
Route::get('/logout', array('as' => 'logout', 'uses' => 'UsersController@logout'));
Route::get('documents', 'DocumentsController@index')->before('auth');
Route::get('okofs', 'OkofsController@index')->before('auth');
Route::get('organizations', 'OrganizationsController@all')->before('auth');
Route::get('/admin', ['as' => 'admin', 'uses' => 'AdminController@index'])->before('auth');
Route::get('test', function () {
if (($handle = fopen('file.csv', 'r')) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) {
$item = new Item();
$item->name = $data[0];
$item->save();
}
fclose($handle);
}
return item::all();
});
Route::get('reports_2015', function () {
return View::make('reports');
});
Route::group(array('before' => 'auth'), function () {
Route::controller('org', 'OrganizationsController');
Route::controller('documents', 'DocumentsController');
Route::controller('Items', 'ItemsController');
Route::controller('Okofs', 'OkofsController');
Route::controller('admin', 'AdminController');
Route::controller('organization', 'OrganizationsController');
Route::controller('oss', 'OssController');
});
示例2: showAll
public function showAll()
{
//
return view('admin.item.showAll')->with('item', item::all());
}