本文整理汇总了PHP中Page::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::all方法的具体用法?PHP Page::all怎么用?PHP Page::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupLayout
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if (!is_null($this->layout)) {
$categories = Category::all();
$pages = Page::all();
$this->layout = View::make($this->layout)->with('styles', $this->styles)->with('scripts', $this->scripts)->with('content_title', '')->with('categories', $categories)->with('pages', $pages)->with('inline_js', $this->inline_js)->with('sidebar', null);
}
}
示例2: test_save_transaction
public function test_save_transaction()
{
$pageLangs = ['en_US' => new PageLangDTO('name 1', 'content 1', 'seo title 1', 'seo description 1', 'handle 1'), 'pt_BR' => null];
try {
$this->pageService->save(true, $pageLangs);
} catch (Exception $ignore) {
}
$pages = Page::all();
$this->assertEmpty($pages);
}
示例3: index
public function index()
{
if (\Input::get('theme')) {
\Cookie::queue('theme', \Input::get('theme'), 100);
return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100));
}
$data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
//dd($data['videos']);
return View::make('Theme::home', $data);
}
示例4: index
public function index()
{
$search_value = Input::get('value');
if (empty($search_value)) {
return Redirect::to('/');
}
$videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
$posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
$data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::search-list', $data);
}
示例5: category
public function category($category)
{
$page = Input::get('page');
if (!empty($page)) {
$page = Input::get('page');
} else {
$page = 1;
}
$cat = PostCategory::where('slug', '=', $category)->first();
$data = array('posts' => Post::where('active', '=', '1')->where('post_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate($this->posts_per_page), 'current_page' => $page, 'category' => $cat, 'page_title' => 'Posts - ' . $cat->name, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/posts/category/' . $category, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::post-list', $data);
}
示例6: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index($category_slug)
{
$categories = Category::all();
$cat_id = 0;
foreach ($categories as $category) {
if ($category->name == $category_slug || strtolower($category->name) == $category_slug) {
$cat_id = $category->id;
break;
}
}
$data = array('media' => Media::where('active', '=', 1)->where('category_id', '=', $cat_id)->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page')), 'categories' => Category::all(), 'pages' => Page::all(), 'settings' => Setting::first());
return View::make('Theme::home', $data);
}
示例7: show_favorites
public function show_favorites()
{
if (!Auth::guest()) {
$page = Input::get('page');
if (empty($page)) {
$page = 1;
}
$favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get();
$favorite_array = array();
foreach ($favorites as $key => $fave) {
array_push($favorite_array, $fave->video_id);
}
$videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12);
$data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::video-list', $data);
} else {
return Redirect::to('videos');
}
}
示例8: getMenu
public static function getMenu()
{
$page = Page::all();
foreach ($page as $value) {
$route = $value['route'];
$title = $value['title'];
?>
<li><a href="<?php
echo $route;
?>
"><?php
echo $title;
?>
</a></li>
<?php
}
}
示例9: home
public function home()
{
try {
$settings = Setting::first();
if ($settings) {
$search = Input::get('search');
if (isset($search)) {
$media = Media::where('active', '=', 1)->where('title', 'LIKE', '%' . $search . '%')->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page'));
} else {
$media = Media::with('media_likes', 'comments')->where('active', '=', 1)->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page'));
}
$categories = Category::orderBy('order', 'ASC')->get();
$pages = Page::all();
$data = array('media' => $media, 'search' => $search, 'categories' => $categories, 'pages' => $pages, 'settings' => Setting::first());
return View::make('Theme::home', $data);
} else {
throw new Exception('settings not set, first install the script');
}
} catch (Exception $e) {
return Redirect::to('install.php');
}
}
示例10: get_create
public function get_create()
{
$this->data['create'] = true;
$this->data['pages'] = Page::all();
return View::make('admin.' . $this->views . '.form', $this->data);
}
示例11: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$pages = Page::all();
return View::make('backend.pages.index')->with('pages', $pages);
}
示例12: all
function all($request)
{
$page = new Page();
$list = $page->all($page);
echo json_encode($list);
}
示例13: action_new
public function action_new()
{
$pages = Page::all();
$tree = $this->createTree($pages);
return View::make('admin.pages.new')->with('pages', $tree);
}
示例14: index
/**
* Display a listing of pages
*
* @return Response
*/
public function index()
{
$pages = Page::all()->except(array(1, 2));
return View::make('pages.index', compact('pages'));
}
示例15: isset
<?php
include '../../inc/init.inc';
isset($conditions) ? $args['conditions'] = $conditions : '';
$res->total = isset($args) ? Page::count($args) : Page::count();
$res->currentPage = isset($currentPage) ? $currentPage : 1;
$res->limit = $args['limit'] = isset($limit) ? $limit : 7;
$args['offset'] = ($res->currentPage - 1) * $args['limit'];
$args['order'] = isset($order) ? $order : 'created_at desc';
$res->pages = Page::all($args);
$res->search_opts = array(0 => array('label' => 'Quel article cherchez vous ?', 'field' => 'title', 'type' => 'text', 'class' => 'xxlarge'));
$res->useTemplate("Wiki");