本文整理汇总了PHP中Pages::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::add方法的具体用法?PHP Pages::add怎么用?PHP Pages::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pages
protected function pages()
{
$kirby = $this->kirbyInstance();
$site = $this->siteInstance($kirby);
$a = $site->find('a');
$b = $site->find('b');
$home = $site->find('home');
$pages = new Pages();
$pages->add($a);
$pages->add($b);
$pages->add($home);
return $pages;
}
示例2: add
public function add()
{
if (Input::method() == 'POST') {
if (Pages::add()) {
return Response::redirect($this->admin_url . '/pages/edit/' . Db::insert_id());
}
}
Template::render('pages/add');
}
示例3: foreach
foreach ($postsYear as $a) {
if ($a->date('m') == $month) {
$postsMonth->add($a);
}
}
// get month-name from number
$dateObj = DateTime::createFromFormat('!m', $month);
$monthName = $dateObj->format('F');
// March
$archiveTitle = ' for ' . $monthName . ' ' . $year;
$posts = $postsMonth;
// filter by day
if (isset($data['day'])) {
$day = $data['day'];
$postsDay = new Pages();
foreach ($postsMonth as $a) {
if ($a->date('d') == $day) {
$postsDay->add($a);
}
}
$archiveTitle = ' for ' . $day . '. ' . $monthName . ' ' . $year;
$posts = $postsDay;
}
}
}
// add pagination
$posts = $posts->paginate(c::get('pagination-archive'));
$pagination = $posts->pagination();
//pass all variables to the template
return compact('posts', 'archiveTitle', 'data', 'pagination', 'year');
};
示例4: Pages
$page = $page->parent();
?>
<div class="content new tp-<?php
echo $page->template();
?>
" data-parent="<?php
echo $page->parent()->uid();
?>
" data-uid="<?php
echo $page->uid();
?>
">
<?php
$collections = new Pages();
$collections->add($page->page1()->toPage());
$collections->add($page->page2()->toPage());
$collections->add($page->page3()->toPage());
$collections->add($page->page4()->toPage());
$n = 0;
foreach ($collections as $collect) {
$n += 1;
?>
<div class="slide" data-count="<?php
echo $n;
?>
">
<img src="<?php
echo $collect->image()->url();
?>
" alt="">