本文整理汇总了PHP中page::create方法的典型用法代码示例。如果您正苦于以下问题:PHP page::create方法的具体用法?PHP page::create怎么用?PHP page::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page
的用法示例。
在下文中一共展示了page::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Creates a new subpage
*
* @param string $uid
* @param string $template
* @param array $data
*/
public function create($uid, $template, $data = array())
{
$page = page::create($this->page->id() . '/' . $uid, $template, $data);
$this->data[$page->id()] = $page;
return $page;
}
示例2: exit
<?php
defined('ROOT') or exit('No direct script access allowed');
$page = new page();
# Création, de la page
$id = $core->getUrlParam(1) ? $core->getUrlParam(1) : false;
if (!$id) {
$pageItem = $page->createHomepage();
} elseif ($pageItem = $page->create($id)) {
} else {
$core->error404();
}
//if($pageItem == false) $core->error404();
# Gestion du titre
if ($runPlugin->getConfigVal('hideTitles')) {
$runPlugin->setMainTitle('');
} else {
$runPlugin->setMainTitle($pageItem->getMainTitle() != '' ? $pageItem->getMainTitle() : $pageItem->getName());
}
# Gestion des metas
if ($pageItem->getIsHomepage()) {
if ($pageItem->getMetaTitleTag() == '') {
$runPlugin->setTitleTag($pageItem->getName());
} else {
$runPlugin->setTitleTag($pageItem->getMetaTitleTag());
}
if ($pageItem->getMetaDescriptionTag() == '') {
$runPlugin->setMetaDescriptionTag($core->getConfigVal('siteDescription'));
} else {
$runPlugin->setMetaDescriptionTag($pageItem->getMetaDescriptionTag());
}
示例3: getPageContent
public static function getPageContent($id)
{
$page = new page();
if ($temp = $page->create($id)) {
return $temp->getContent();
} else {
return '';
}
}
示例4: create
/**
* Creates a new subpage
*
* @param string $uid
* @param string $template
* @param array $data
*/
public function create($uid, $template, $data = array())
{
return page::create($this->page->id() . '/' . $uid, $template, $data);
}
示例5: exit
<?php
defined('ROOT') or exit('No direct script access allowed');
$mode = '';
$action = isset($_GET['action']) ? urldecode($_GET['action']) : '';
$msg = isset($_GET['msg']) ? urldecode($_GET['msg']) : '';
$msgType = isset($_GET['msgType']) ? $_GET['msgType'] : '';
$error = false;
$hideTitles = $runPlugin->getConfigVal('hideTitles');
$page = new page();
switch ($action) {
case 'save':
if ($administrator->isAuthorized()) {
if ($_POST['id'] != '') {
$pageItem = $page->create($_POST['id']);
} else {
$pageItem = new pageItem();
}
$pageItem->setName($_POST['name']);
$pageItem->setPosition($_POST['position']);
$pageItem->setIsHomepage(isset($_POST['isHomepage']) ? 1 : 0);
$pageItem->setContent($_POST['content']);
$pageItem->setFile($_POST['file']);
$pageItem->setIsHidden(isset($_POST['isHidden']) ? 1 : 0);
$pageItem->setMainTitle($_POST['mainTitle']);
$pageItem->setMetaDescriptionTag($_POST['metaDescriptionTag']);
$pageItem->setMetaTitleTag($_POST['metaTitleTag']);
$pageItem->setTarget($_POST['target']);
$pageItem->setTargetAttr($_POST['targetAttr']);
if ($page->save($pageItem)) {
$msg = $core->lang("The changes have been saved.");