当前位置: 首页>>代码示例>>PHP>>正文


PHP SwatDBClassMap::add方法代码示例

本文整理汇总了PHP中SwatDBClassMap::add方法的典型用法代码示例。如果您正苦于以下问题:PHP SwatDBClassMap::add方法的具体用法?PHP SwatDBClassMap::add怎么用?PHP SwatDBClassMap::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SwatDBClassMap的用法示例。


在下文中一共展示了SwatDBClassMap::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getConfigDefinitions

    // }}}
    // {{{ public static function getConfigDefinitions()
    /**
     * Gets configuration definitions used by Blörgy
     *
     * Applications should add these definitions to their config module before
     * loading the application configuration.
     *
     * This contains default configuration values which may be overridden in
     * a loaded configuration file.
     *
     * @return array the configuration definitions used by this package.
     *
     * @see SiteConfigModule::addDefinitions()
     */
    public static function getConfigDefinitions()
    {
        return array('site.theme' => 'default');
    }
    // }}}
    // {{{ private function __construct()
    /**
     * Prevent instantiation of this static class
     */
    private function __construct()
    {
    }
}
SwatDBClassMap::addPath(dirname(__FILE__) . '/dataobjects');
SwatDBClassMap::add('SiteArticle', 'Article');
开发者ID:nburka,项目名称:blorgy,代码行数:30,代码来源:Blorgy.php

示例2: displayAd

     * If $config->pinhole->ad_referers_only is true, the referer's domain is
     * checked against the site's domain to ensure the page has been arrived at
     * via another site.
     *
     * @param SiteApplication $app The current application
     * @param string $ad_type The type of ad to display
     */
    public static function displayAd(SiteApplication $app, $type)
    {
        $type_name = 'ad_' . $type;
        if ($app->config->pinhole->{$type_name} != '') {
            $base_href = $app->getBaseHref();
            $referer = SiteApplication::initVar('HTTP_REFERER', null, SiteApplication::VAR_SERVER);
            // Display ad if referers only is off OR if there is a referer and
            // it does not start with the app base href.
            if (!$app->config->pinhole->ad_referers_only || $referer !== null && strncmp($referer, $base_href, strlen($base_href)) != 0) {
                echo '<div class="ad">';
                echo $app->config->pinhole->{$type_name};
                echo '</div>';
            }
        }
    }
}
Pinhole::setupGettext();
// require here to prevent "Class __PHP_Incomplete_Class has no unserializer" errors
require_once 'Pinhole/dataobjects/PinholeAdminUser.php';
SwatDBClassMap::addPath(dirname(__FILE__) . '/dataobjects');
SwatDBClassMap::add('AdminUser', 'PinholeAdminUser');
SiteGadgetFactory::addPath('Pinhole/gadgets');
SiteViewFactory::addPath('Pinhole/views');
SiteViewFactory::registerView('photo-comment', 'PinholeCommentView');
开发者ID:gauthierm,项目名称:pinhole,代码行数:31,代码来源:Pinhole.php


注:本文中的SwatDBClassMap::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。