當前位置: 首頁>>代碼示例>>PHP>>正文


PHP app\Page類代碼示例

本文整理匯總了PHP中app\Page的典型用法代碼示例。如果您正苦於以下問題:PHP Page類的具體用法?PHP Page怎麽用?PHP Page使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Page類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: moduleAndPageCreate

 public function moduleAndPageCreate($request)
 {
     $projectID = Project::orderBy('id', 'desc')->first();
     $modules = $request->projected_total_modules;
     $m = 1;
     $pages = $request->projected_total_pages / $request->projected_total_modules;
     $p = 1;
     $pageNumber = 1;
     while ($m <= $modules) {
         $newModule = new Module();
         $newModule->project_id = $projectID->id;
         $newModule->name = 'Modulo' . $m;
         $newModule->projected_total_pages = $pages;
         $newModule->save();
         $p = 1;
         while ($p <= $pages) {
             $moduleID = Module::orderBy('id', 'desc')->first();
             $newPage = new Page();
             $newPage->module_id = $moduleID->id;
             $newPage->name = $pageNumber;
             $newPage->save();
             $p++;
             $pageNumber++;
         }
         $m++;
     }
 }
開發者ID:AmilcarCondino,項目名稱:Circulo_v2,代碼行數:27,代碼來源:Project.php

示例2: showPage

 /**
  * @param \App\Page $page
  */
 public function showPage(\App\Page $page)
 {
     if (!$page->isPublished()) {
         abort(404);
     }
     return view('page', ['page_title' => $page->title, 'page_content' => $page->content]);
 }
開發者ID:stcoder,項目名稱:uf-vova,代碼行數:10,代碼來源:PageController.php

示例3: index

 public function index(Page $page, PhotogalleriesGallery $photogalleriesGallery, Banner $banner, Service $service)
 {
     $about = $page->geByTitle('about');
     $banners = $banner->getByWeight();
     $services = $service->getOnTop();
     $gallery = $photogalleriesGallery->random();
     return view('index', ['banners' => $banners, 'services' => $services, 'about' => $about[0], 'gallery' => $gallery]);
 }
開發者ID:Blu2z,項目名稱:minesko,代碼行數:8,代碼來源:MainController.php

示例4: destroy

 public function destroy(Page $page)
 {
     if ($page->image && \File::exists(public_path() . "/" . $page->image)) {
         \File::delete(public_path() . "/" . $page->image);
     }
     $page->delete();
     return redirect()->route("backend.page.index");
 }
開發者ID:erayaydin,項目名稱:erayaydin,代碼行數:8,代碼來源:PageController.php

示例5: update

 /**
  * Update the specified resource in storage.
  *
  * @param \Illuminate\Http\Request $request
  * @param \App\Page                $page
  *
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Page $page)
 {
     $this->authorize($page->permission);
     $page->body = $request->body;
     $page->updated_by = $request->user()->id;
     $page->save();
     return redirect()->route($page->name)->with('status', 'Siden ble lagret.');
 }
開發者ID:scriptotek,項目名稱:ub-baser,代碼行數:16,代碼來源:PageController.php

示例6: create

 public function create($data)
 {
     $page = new Page($data);
     if (!$data['parent_id']) {
         $page->parent_id = null;
     }
     $page->save();
     return $page;
 }
開發者ID:manogi,項目名稱:gfw-qm,代碼行數:9,代碼來源:EloquentPageRepository.php

示例7: destroy

 public function destroy(Page $page)
 {
     if (\Request::has('id')) {
         Page::destroy(\Request::input('id'));
         return ['result' => true];
     }
     $page->delete();
     return redirect('dash/page')->with('message', 'Page was delete success.');
 }
開發者ID:ravuthz,項目名稱:cms-laravel5.1,代碼行數:9,代碼來源:PageController.php

示例8: update

 public function update(Requests\Pages\EditPageRequest $request, $id, StoreFile $storeFile, \App\Page $page)
 {
     if ($request->hasFile('image')) {
         $image_path = $storeFile->move($request->file('image'), 'images/pages/', 16);
         $modified_request = array_merge($request->all(), ['image' => $image_path]);
     } else {
         $modified_request = $request->except('image');
     }
     $page->findOrFail($id)->update($modified_request);
     //Redirect
     return redirect()->action('Panel\\PagesController@index');
 }
開發者ID:omar3f,項目名稱:new-watania,代碼行數:12,代碼來源:PagesController.php

示例9: post_year

 public function post_year($year)
 {
     // возвращаем посты за year
     # обращаемся к моделе Category
     $Categories = new Categories();
     $categories = $Categories->cats_for_header();
     # обращаемся к моделе Page
     $pages = new Page();
     $footer_pages = $pages->footer_pages();
     $Posts_model = new Posts();
     $posts = $Posts_model->post_of_year($year);
     return view('layouts.default', ['categories' => $categories, 'pages' => $footer_pages, 'content_layout' => 'posts_content', 'posts' => $posts]);
 }
開發者ID:kooler62,項目名稱:liveandlearn,代碼行數:13,代碼來源:PostController.php

示例10: Page

 function __construct()
 {
     $page = new Page();
     // Check if it has some uri
     if ($uri = $page->getUri()) {
         return $page->redirectTo($uri);
     }
     // Check if it's a post request
     if ($_POST) {
         $input = $page->inputValidate($_POST);
         $page->url_obj->store($input);
     }
     $page->renderPage('default');
 }
開發者ID:tarasikarius,項目名稱:url_min,代碼行數:14,代碼來源:App.php

示例11: index

 public function index()
 {
     # обращаемся к моделе Category
     $vrode_model = new Categories();
     $categories = $vrode_model->cats_for_header();
     # обращаемся к моделе Page
     $pages = new Page();
     $footer_pages = $pages->footer_pages();
     //Получение разбитого на страницы запроса из базы данных:
     $postsi = new Posts();
     $per_page = 10;
     $posts = $postsi->post_paginate($per_page);
     return view('layouts.default', ['categories' => $categories, 'pages' => $footer_pages, 'content_layout' => 'posts_content', 'posts' => $posts]);
 }
開發者ID:kooler62,項目名稱:liveandlearn,代碼行數:14,代碼來源:PostsController.php

示例12: oshu

 public function oshu()
 {
     $page = Page::where('slug', 'oshu')->first();
     if ($page == null) {
         $new = new Page();
         $new->slug = 'oshu';
         $new->nav_title = 'OSHU - Wat doen we?';
         $new->title = 'test';
         $new->body = 'test';
         $new->save();
     }
     $page = Page::where('slug', 'oshu')->first();
     $examples = Example::all();
     return view('pages.public.oshu', compact('page', 'examples'));
 }
開發者ID:svuvis,項目名稱:oshusite,代碼行數:15,代碼來源:PublicController.php

示例13: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $pages = Page::all();
     $cities = City::all();
     view()->share('pages', $pages);
     view()->share('cities', $cities);
 }
開發者ID:AbuLoot,項目名稱:vi,代碼行數:12,代碼來源:AppServiceProvider.php

示例14: update

 public function update(Request $request)
 {
     $input = $request->all();
     $page = Page::find(1);
     $page->update(['user_id' => Auth::user()->id, 'is_active' => 1, 'meta_title' => $input['meta_title'], 'meta_desc' => $input['meta_desc'], 'title_h1' => $input['title_h1'], 'title_h2' => $input['title_h2'], 'desc' => $input['desc'], 'content' => $input['content'], 'sender' => $input['sender']]);
     $page->cover->update(['name' => $input['background_image_name'], 'url' => 'cover']);
     if (isset($input['background_image'])) {
         $file = base_path() . '/public/assets/images/about/cover.jpg';
         $img = Image::make($input['background_image']);
         $img->save($file);
     }
     foreach ($page->pictures as $key => $pic) {
         if (isset($input['about_image_name_' . $key])) {
             $pic->picture->name = $input['about_image_name_' . $key];
             $pic->picture->save();
         }
         if (isset($input['about_image_' . $key])) {
             $unique_name = md5(microtime());
             $file = base_path() . '/public/assets/images/about/' . $unique_name . '.jpg';
             $img = Image::make($input['about_image_' . $key]);
             $img->save($file);
             $pic->picture->url = $unique_name;
             $pic->picture->save();
         }
     }
     return redirect()->route('about');
 }
開發者ID:antoinemy,項目名稱:folio-old,代碼行數:27,代碼來源:AboutController.php

示例15: home

 public function home()
 {
     $data['forsidumyndir'] = \App\Page::where('slug', '_forsidumyndir')->first()->getSubs();
     $cats = \App\Category::where('status', 1)->get();
     $prods = \App\Product::where('status', 1)->get();
     $items = [$cats, $prods];
     $kubbar = [];
     foreach ($items as $item) {
         foreach ($item as $v) {
             $frontpaged = trim($v->extras()->get('frontpaged')) ?: 0;
             $size = trim($v->extras()->get('size'));
             $titill = trim($v->extras()->get('titill')) ?: $v->title;
             if ($frontpaged && $frontpaged != 0) {
                 $kubbar[] = ['title' => $titill, 'size' => $size ? $size : 1, 'frontpaged' => $frontpaged, 'fillimage' => $v->fillimage ? true : false, 'path' => $v->fullPath(), 'image' => $v->img()->first(), 'slug' => $v->slug];
             }
         }
     }
     usort($kubbar, function ($a, $b) {
         if ($a['frontpaged'] == $b['frontpaged']) {
             return 0;
         }
         return $a['frontpaged'] < $b['frontpaged'] ? -1 : 1;
     });
     $data['kubbar'] = $kubbar;
     return view('frontend.layout')->with($data);
 }
開發者ID:stjanilofts,項目名稱:kl,代碼行數:26,代碼來源:HomeController.php


注:本文中的app\Page類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。