本文整理汇总了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']));
}
示例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);
}
};
}
示例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);
}
示例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);
}
示例5: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Page::create([]);
}
}
示例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]);
}
}
示例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]);
}
}
示例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);
}
示例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);
}
示例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' => '']);
}
示例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'));
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}