當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SinglePage::getByPath方法代碼示例

本文整理匯總了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']);
開發者ID:rratcliffe,項目名稱:fsen,代碼行數:31,代碼來源:install.php


注:本文中的SinglePage::getByPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。