本文整理汇总了PHP中Pages::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::all方法的具体用法?PHP Pages::all怎么用?PHP Pages::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postOrder
public function postOrder()
{
$pages = Pages::all();
foreach ($pages as $page) {
$page->order = count($pages) - 1;
$page->save();
}
foreach (Input::get('data') as $item) {
$this->setOrderPosition($item);
}
return Response::json(Input::get('data'));
}
示例2: str_replace
/* $fileContents= file_get_contents($page_values->page_url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
$values=json_decode($json,true);*/
// return $section_values;
//return Pages::all();
// return $values['form']['field'][0]['@attributes']['group'];
// return $page_values->page_url;
return View::make('editSection')->with(['section_values' => $section_values]);
});
Route::get('/delete', function () {
$page_values = Pages::where('id', '=', Input::get('id'))->first();
DB::table('pages')->where('id', '=', Input::get('id'))->delete();
$pages = Pages::all();
if (File::exists($page_values->page_url)) {
File::delete($page_values->page_url);
}
return View::make('table')->with(['message' => "Page deleted successfully", 'pages' => $pages]);
});
Route::get('/deleteSection', function () {
$page_values = Sections::where('id', '=', Input::get('id'))->first();
DB::table('sections')->where('id', '=', Input::get('id'))->delete();
$sections = Sections::all();
if (File::exists($page_values->section_url)) {
File::deleteDirectory($page_values->section_url);
}
return View::make('upload')->with(['message' => "Section deleted successfully", 'sections' => $sections]);
});
Route::get('/section', function () {
示例3: array
return array('laracms/extends/backend/widgets');
}, 1);
Event::listen('backend.sidebar.create', function () {
return array('laracms/extends/backend/sidebarmenu');
}, 1);
Event::listen('backend.navbar.create', function () {
return array('laracms/extends/backend/tools');
}, 1);
Event::listen('backend.footer.create', function () {
return array('laracms/extends/backend/footer');
}, 1);
Event::listen('backend.header.create', function () {
return array('laracms/extends/backend/header');
}, 1);
Event::listen('laracms.pages.all', function ($params) {
return Pages::all();
}, 1);
Event::listen('laracms.main.content', function ($params) {
return Config::get('cms.controller.content');
}, 1);
Event::listen('laracms.pages.last', function ($params) {
return Pages::orderby('created_at', 'desc')->first();
}, 1);
Event::listen('laracms.menus.specific', function ($params) {
$specific = Cache::remember('laracms_specific_menu_' . $params['menuid'], 60, function () use($params) {
$menu = Menus::find($params['menuid']);
$it = $menu->menuitems;
$items = array();
$content = Event::fire('laracms.collect.content.types');
foreach ($it as $k => $ti) {
$items[$k] = $ti;