本文整理汇总了PHP中PageManager::add方法的典型用法代码示例。如果您正苦于以下问题:PHP PageManager::add方法的具体用法?PHP PageManager::add怎么用?PHP PageManager::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageManager
的用法示例。
在下文中一共展示了PageManager::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add()
{
PageManager::add($this->title, $this->content, $this->author, $this->is_event);
}
示例2: __actionEdit
//.........这里部分代码省略.........
if (!empty($duplicate)) {
if ($autogenerated_handle) {
$this->_errors['title'] = __('A page with that title already exists');
} else {
$this->_errors['handle'] = __('A page with that handle already exists');
}
} else {
// New page?
if (empty($current)) {
$file_created = PageManager::createPageFiles($fields['path'], $fields['handle']);
} else {
$file_created = PageManager::createPageFiles($fields['path'], $fields['handle'], $current['path'], $current['handle']);
}
// If the file wasn't created, it's usually permissions related
if (!$file_created) {
$redirect = null;
return $this->pageAlert(__('Page Template could not be written to disk.') . ' ' . __('Please check permissions on %s.', array('<code>/workspace/pages</code>')), Alert::ERROR);
}
// Insert the new data:
if (empty($current)) {
/**
* Just prior to creating a new Page record in `tbl_pages`, provided
* with the `$fields` associative array. Use with caution, as no
* duplicate page checks are run after this delegate has fired
*
* @delegate PagePreCreate
* @since Symphony 2.2
* @param string $context
* '/blueprints/pages/'
* @param array $fields
* The `$_POST['fields']` array passed by reference
*/
Symphony::ExtensionManager()->notifyMembers('PagePreCreate', '/blueprints/pages/', array('fields' => &$fields));
if (!($page_id = PageManager::add($fields))) {
$this->pageAlert(__('Unknown errors occurred while attempting to save.') . '<a href="' . SYMPHONY_URL . '/system/log/">' . __('Check your activity log') . '</a>.', Alert::ERROR);
} else {
/**
* Just after the creation of a new page in `tbl_pages`
*
* @delegate PagePostCreate
* @since Symphony 2.2
* @param string $context
* '/blueprints/pages/'
* @param integer $page_id
* The ID of the newly created Page
* @param array $fields
* An associative array of data that was just saved for this page
*/
Symphony::ExtensionManager()->notifyMembers('PagePostCreate', '/blueprints/pages/', array('page_id' => $page_id, 'fields' => &$fields));
$redirect = "/blueprints/pages/edit/{$page_id}/created/{$parent_link_suffix}";
}
} else {
/**
* Just prior to updating a Page record in `tbl_pages`, provided
* with the `$fields` associative array. Use with caution, as no
* duplicate page checks are run after this delegate has fired
*
* @delegate PagePreEdit
* @since Symphony 2.2
* @param string $context
* '/blueprints/pages/'
* @param integer $page_id
* The ID of the Page that is about to be updated
* @param array $fields
* The `$_POST['fields']` array passed by reference
*/
示例3: foreach
$views[] = $span->textContent;
}
}
}
}
$bddpage->setViews($views[0]);
//nb dl
foreach ($page->getElementsByTagName('span') as $spans) {
if ($spans->getAttribute('class') == 'thing-downloads') {
foreach ($spans->getElementsByTagName('span') as $span) {
if ($span->getAttribute('class') == 'interaction-count') {
$dls[] = $span->textContent;
}
}
}
}
$bddpage->setDls($dls[0]);
$pageManager->add($bddpage);
} else {
echo '404';
}
}
}
ob_start();
//print_r($bddpage);
require_once 'view/pipe/pipeexecnext.php';
$content = ob_get_contents();
ob_end_clean();
require_once 'view/layout/layout.php';
break;
}