当前位置: 首页>>代码示例>>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;未经允许,请勿转载。