本文整理汇总了PHP中SinglePage::getByPath方法的典型用法代码示例。如果您正苦于以下问题:PHP SinglePage::getByPath方法的具体用法?PHP SinglePage::getByPath怎么用?PHP SinglePage::getByPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SinglePage
的用法示例。
在下文中一共展示了SinglePage::getByPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flush
$masterCollection->update(array('cCacheFullPageContent' => 1, 'cCacheFullPageContentOverrideLifetime' => 'custom', 'cCacheFullPageContentLifetimeCustom' => 10));
} else {
// follow system default for other page types
$masterCollection->update(array('cCacheFullPageContent' => -1, 'cCacheFullPageContentOverrideLifetime' => '0', 'cCacheFullPageContentLifetimeCustom' => 0));
}
}
}
flush();
ob_flush();
}
// install single pages
$single_pths = array(array('cHandle' => 'fse_login', 'cName' => 'Sign in', 'cDescription' => 'Sign in', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_login'))), array('cHandle' => 'fse_logout', 'cName' => 'Sign out', 'cDescription' => 'Sign out'), array('cHandle' => 'fse_register', 'cName' => 'Sign up', 'cDescription' => 'Sign up', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_register'))), array('cHandle' => 'fse_request_to_reset_password', 'cName' => 'Request to Reset Password', 'cDescription' => 'Request to reset password via your primary email', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_request_to_reset_password'))), array('cHandle' => 'fse_reset_password', 'cName' => 'Reset Password', 'cDescription' => 'Reset password', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_reset_password'))), array('cHandle' => 'fse_validate_email', 'cName' => 'Validate Email', 'cDescription' => 'Validate your primary email'), array('cHandle' => 'fse_settings', 'cName' => 'Personal Settings', 'cDescription' => 'Your personal settings'), array('cHandle' => 'fse_settings/profile', 'cName' => 'Profile', 'cDescription' => 'Your profile', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_profile'))), array('cHandle' => 'fse_settings/account', 'cName' => 'Account', 'cDescription' => 'Account settings', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_change_password'), array('areaHandle' => 'Main', 'btHandle' => 'fse_email_settings'), array('areaHandle' => 'Main', 'btHandle' => 'fse_delete_account'))), array('cHandle' => 'fse_settings/applications', 'cName' => 'Applications', 'cDescription' => 'Your application keys', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_app_key'))), array('cHandle' => 'fse_settings/projects', 'cName' => 'Projects', 'cDescription' => 'Your projects', 'blocks' => array(array('areaHandle' => 'Main', 'btHandle' => 'fse_projects'))));
echo '<br/>';
echo 'Creating single pages... <br/>';
foreach ($single_pths as $sp) {
$p = SinglePage::getByPath('/' . $sp['cHandle']);
if ($p->getCollectionID() > 0) {
echo $sp['cHandle'] . ' had been installed; skip installing.<br/>';
} else {
$p = SinglePage::add($sp['cHandle'], $pkg);
if ($p instanceof SinglePage) {
$p->update(array('cName' => $sp['cName'], 'cDescription' => $sp['cDescription']));
}
echo $sp['cHandle'] . ' newly installed.<br/>';
}
echo ' Check/add block to this single page...';
// add block to single pages
if (count($sp['blocks']) > 0) {
foreach ($sp['blocks'] as $b) {
if (count($p->getBlocks($b['areaHandle'])) == 0) {
$block_type = BlockType::getByHandle($b['btHandle']);