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


PHP Page::create方法代碼示例

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


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

示例1: array

 public function testPHP構文チェック異常係()
 {
     $this->markTestIncomplete('このテストは、まだ実裝されていません。');
     $this->Page->create(array('Page' => array('name' => 'test', 'contents' => '<?php ??>')));
     $this->assertFalse($this->Page->validates());
     $this->assertArrayHasKey('contents', $this->Page->validationErrors);
     $this->assertEquals("PHPの構文エラーです: \nPHP Parse error:  syntax error, unexpected '?' in - on line 1 \nErrors parsing -", current($this->Page->validationErrors['contents']));
 }
開發者ID:baserproject,項目名稱:basercms,代碼行數:8,代碼來源:PageTest.php

示例2: createComponentPageEditForm

 protected function createComponentPageEditForm($name)
 {
     $form = $this->createPageFormBase($name, false);
     if (!$form->isSubmitted()) {
         $id = $this->getParam("id");
         $page = Page::find($id);
         $values = $page->getValues();
         $values["tags"] = $page->Tags->fetchColumn("id");
         $form->setDefaults($values);
     }
     $presenter = $this;
     $form->onSubmit[] = function ($form) use($presenter) {
         $values = $form->values;
         try {
             $page = Page::create($values);
             $page->Tags = array_map(function ($id) {
                 return Tag::create($id);
             }, $values["tags"]);
             $page->save();
             $presenter->flashMessage("Page '{$page->name}' was changed!");
             $presenter->redirect("default", array("id" => $page->id));
         } catch (ModelException $e) {
             $page->addErrorsToForm($form);
         }
     };
 }
開發者ID:janmarek,項目名稱:Ormion,代碼行數:26,代碼來源:PagePresenter.php

示例3: index

 /**
  * 默認函數
  * Enter description here ...
  */
 public function index()
 {
     $pageIndex = $this->input->get('page') ? $this->input->get('page') : 1;
     $xml = new XML();
     $file = fopen("Area.xml", "r") or die("Unable to open file!");
     //讀取XML內容
     $filetxt = "";
     $filetxt = fread($file, filesize("../uploadfile/Area/Area.xml"));
     //將文件中的序列化字符串讀出
     $unTreeresult = $xml->xml_unserialize($filetxt);
     //反序成內容
     fclose($file);
     //關閉文件
     $tree = new Tree();
     //新建一個樹
     $totalCount = count($unTreeresult["root"]["item"]);
     //獲得數據總條目
     $pageSize = 100;
     $first = ($pageIndex - 1) * $pageSize;
     //得到獲得數組循環的首下表
     $end = $pageIndex * $pageSize;
     //尾下標-1
     $end <= $totalCount ? "" : ($end = $totalCount);
     $result = array();
     //取得小樹
     for ($first; $first < $end; $first++) {
         $result[] = $unTreeresult["root"]["item"][$first];
     }
     $page = new Page();
     $str_page = $page->create($pageIndex, $pageSize, $totalCount, array(), array());
     $data['page'] = $str_page;
     $data['result'] = $result;
     $this->load->view('Area/list', $data);
 }
開發者ID:ZuoYouLai,項目名稱:tkglxtphp,代碼行數:38,代碼來源:Area.php

示例4: indexAction

 public function indexAction()
 {
     $score_list = $this->sScore->getSearchList($this->getParams(), $this->_offset, $this->_pagesize);
     $score_count = $this->sScore->getSearchCount($this->getParams());
     $data = array('params' => $this->getParams(), 'score_list' => $score_list, 'page' => Page::create($score_count, $this->_pagesize), 'score_type' => $this->sCommon->getScoretype());
     $this->view("index", $data);
 }
開發者ID:hexcode007,項目名稱:yfcms,代碼行數:7,代碼來源:ScoreController.php

示例5: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Page::create([]);
     }
 }
開發者ID:peintune,項目名稱:Ternado,代碼行數:7,代碼來源:PageTableSeeder.php

示例6: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Page::create(['title' => $faker->sentence($nbWords = 6), 'slug' => 'first-page', 'body' => $faker->sentence($nbSentences = 5), 'user_id' => 1]);
     }
 }
開發者ID:shushanxingzhe,項目名稱:laravelblog,代碼行數:7,代碼來源:PageTableSeeder.php

示例7: run

 public function run()
 {
     DB::table('article')->delete();
     for ($i = 0; $i < 10; $i++) {
         Page::create(['name' => 'Name ' . $i, 'user_id' => '1', 'content' => 'Body- ' . $i]);
     }
 }
開發者ID:bcawosxy,項目名稱:mars,代碼行數:7,代碼來源:articleTableSeeder.php

示例8: DetailAction

 public function DetailAction($push_id)
 {
     $domian_list = $this->sPushDetail->getSearchList($push_id, $this->getParams(), $this->_offset, $this->_pagesize);
     $domian_count = $this->sPushDetail->getSearchCount($push_id, $this->getParams());
     $data = array('params' => $this->getParams(), 'domain_list' => $domian_list, 'page' => Page::create($domian_count, $this->_pagesize));
     $this->view("detail", $data);
 }
開發者ID:hexcode007,項目名稱:yfcms,代碼行數:7,代碼來源:FilelistController.php

示例9: indexAction

 public function indexAction()
 {
     $member_list = $this->sMembers->getSearchList($this->getParams(), $this->_offset, $this->_pagesize);
     $member_count = $this->sMembers->getSearchCount($this->getParams());
     $data = array('params' => $this->getParams(), 'member_list' => $member_list, 'page' => Page::create($member_count, $this->_pagesize), "product_cat" => json_encode($this->sProductCat->getProductCat()), "product_cat2" => $this->sProductCat->getProductCat(2));
     $this->view("index", $data);
 }
開發者ID:hexcode007,項目名稱:yfcms,代碼行數:7,代碼來源:MembersController.php

示例10: run

 public function run()
 {
     DB::table('pages')->truncate();
     Page::create(['title' => "Home Page", 'body' => 'This will be your home page', 'published' => 1, 'slug' => '/home', 'seo' => 'HOME PAGE SEO', 'menu_sort_order' => 0, 'menu_parent' => 0, 'menu_name' => 'top', 'redirect_url' => '']);
     Page::create(['title' => "About Page", 'body' => 'This will be your about page', 'published' => 1, 'slug' => '/about', 'seo' => 'ABOUT PAGE SEO', 'menu_sort_order' => 1, 'menu_parent' => 1, 'menu_name' => 'top', 'redirect_url' => '']);
     Page::create(['title' => "Contact Page", 'body' => 'This will be your Contact page', 'published' => 1, 'slug' => '/contact', 'menu_sort_order' => 3, 'menu_parent' => 0, 'seo' => 'CONTACT PAGE SEO', 'menu_name' => 'top', 'redirect_url' => '']);
     Page::create(['title' => "All Projects", 'body' => 'All Projects on the site edit Pages and Projects to add text here', 'published' => 1, 'slug' => '/all_projects', 'menu_sort_order' => 2, 'menu_parent' => 0, 'seo' => 'ALL PROJECTS SEO', 'menu_name' => 'left_side', 'redirect_url' => '']);
 }
開發者ID:jboz62,項目名稱:cms,代碼行數:8,代碼來源:PagesTableSeeder.php

示例11: run

 public function run()
 {
     DB::table('page')->delete();
     Page::create(array('title' => 'Home', 'content' => 'Home content', 'user_id' => 1, 'keywords' => 'home', 'description' => 'Home', 'type' => 1, 'start' => 1, 'active' => 1, 'path' => 'home'));
     Page::create(array('title' => 'Service', 'content' => '', 'user_id' => 1, 'keywords' => '', 'description' => '', 'type' => 1, 'start' => 1, 'active' => 1, 'path' => 'service'));
     Page::create(array('title' => 'Occasions', 'content' => 'Occasions', 'user_id' => 1, 'keywords' => '', 'description' => '', 'type' => 3, 'start' => 1, 'active' => 1, 'path' => 'occasions'));
     Page::create(array('title' => 'Contact', 'content' => 'Contact us with the following information:', 'user_id' => 1, 'keywords' => '', 'description' => '', 'type' => 2, 'start' => 1, 'active' => 1, 'path' => 'contact'));
 }
開發者ID:stefferd,項目名稱:autogarageooij,代碼行數:8,代碼來源:PageTableSeeder.php

示例12: IndexAction

 public function IndexAction()
 {
     $domain_list = array();
     $domian_list = $this->sDomain->getSearchList($this->getParams(), $this->_offset, $this->_pagesize);
     $domian_count = $this->sDomain->getSearchCount($this->getParams());
     $data = array('params' => $this->getParams(), 'domain_list' => $domian_list, "product_cat" => json_encode($this->sProductCat->getProductCat()), "product_cat2" => $this->sProductCat->getProductCat(2), 'page' => Page::create($domian_count, $this->_pagesize));
     $this->view("index", $data);
 }
開發者ID:hexcode007,項目名稱:yfcms,代碼行數:8,代碼來源:DomainsController.php

示例13: testNewRecordWithNewReferenced

 public function testNewRecordWithNewReferenced()
 {
     $page = Page::create(array("name" => "English article", "description" => "Description", "text" => "Text in english.", "allowed" => true));
     $page->Tags[] = Tag::create(array("name" => "Society", "url" => "society"));
     $page->Tags[] = Tag::create(array("name" => "Previte", "url" => "previte"));
     $page->save();
     $this->assertEquals(2, count(Page::findByName("English article")->Tags));
 }
開發者ID:janmarek,項目名稱:Ormion,代碼行數:8,代碼來源:ManyToManyTest.php

示例14: testNewRecordWithNewReferenced

 public function testNewRecordWithNewReferenced()
 {
     $page = Page::create(array("name" => "English article", "description" => "Description", "text" => "Text in english.", "allowed" => true));
     $page->Comments[] = Comment::create(array("text" => "muj názor", "name" => "Honza", "mail" => "muj@mail.cz"));
     $page->Comments[] = Comment::create(array("text" => "muj jiný názor", "name" => "Honza", "mail" => "muj@mail.cz"));
     $page->save();
     $this->assertEquals(2, count(Page::findByName("English article")->Comments));
 }
開發者ID:janmarek,項目名稱:Ormion,代碼行數:8,代碼來源:HasManyTest.php

示例15: IndexAction

 public function IndexAction()
 {
     $article_list = $this->sArticles->getSearchList($this->getParams(), $this->_offset, $this->_pagesize);
     $article_count = $this->sArticles->getSearchCount($this->getParams());
     $data = array('params' => $this->getParams(), 'article_list' => $article_list, 'article_type' => $this->sCommon->getArticleCats(), 'audit_list' => $this->audit_list, 'page' => Page::create($article_count, $this->_pagesize));
     //print_r($data);die();
     $this->view("index", $data);
 }
開發者ID:hexcode007,項目名稱:yfcms,代碼行數:8,代碼來源:ArticleController.php


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