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