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


PHP Zikula_View::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param Zikula_ServiceManager $serviceManager ServiceManager.
  * @param string                $module         Module name ("zikula" for system plugins).
  * @param string                $pluginName     Plugin name.
  * @param integer|null          $caching        Whether or not to cache (Zikula_View::CACHE_*) or use config variable (null).
  */
 public function __construct(Zikula_ServiceManager $serviceManager, $module = 'zikula', $pluginName, $caching = null)
 {
     parent::__construct($serviceManager, $module, $caching);
     $this->pluginName = $pluginName;
     if ($this->modinfo['type'] == ModUtil::TYPE_CORE) {
         $path = is_dir("plugins/{$pluginName}/templates/plugins") ? is_dir("plugins/{$pluginName}/templates/plugins") : is_dir("plugins/{$pluginName}/Resources/views/plugins");
     } else {
         $base = ModUtil::getBaseDir($this->modinfo['name']);
         $path = is_dir("{$base}/{$this->modinfo['directory']}/plugins/{$pluginName}/templates/plugins") ? "{$base}/{$this->modinfo['directory']}/plugins/{$pluginName}/templates/plugins" : "{$base}/{$this->modinfo['directory']}/plugins/{$pluginName}/Resources/views/plugins";
     }
     $this->addPluginDir($path);
 }
开发者ID:Silwereth,项目名称:core,代码行数:20,代码来源:Plugin.php

示例2: __construct

 /**
  * Constructor.
  *
  * Use FormUtil::newForm() instead of instantiating Zikula_Form_View directly.
  *
  * @param Zikula_ServiceManager $serviceManager ServiceManager.
  * @param string                $module         Module name.
  * @param integer               $caching        Caching flag (not used - just for e_strict).
  */
 public function __construct(Zikula_ServiceManager $serviceManager, $module, $caching = null)
 {
     // override behaviour of anonymous sessions
     SessionUtil::requireSession();
     // construct and use the available methods
     parent::__construct($serviceManager, $module, false);
     $this->addPluginDir('lib/legacy/viewplugins/formplugins', false);
     $this->setCaching(Zikula_View::CACHE_DISABLED);
     // custom Form setup
     $this->idCount = 1;
     $this->errorMsgSet = false;
     $this->plugins = array();
     $this->blockStack = array();
     $this->redirected = false;
     $this->validators = array();
     $this->validationChecked = false;
     $this->_isValid = null;
     $this->initializeState();
     $this->initializeStateData();
     $this->initializeIncludes();
 }
开发者ID:Silwereth,项目名称:core,代码行数:30,代码来源:View.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param Zikula_ServiceManager $serviceManager ServiceManager.
  * @param string                $themeName      Theme name.
  */
 public function __construct(Zikula_ServiceManager $serviceManager, $themeName)
 {
     // store our theme information
     $this->themeinfo = ThemeUtil::getInfo(ThemeUtil::getIDFromName($themeName));
     // prevents any case mismatch
     $themeName = $this->themeinfo['name'];
     foreach (array('name', 'directory', 'version', 'state', 'xhtml') as $key) {
         $this->{$key} = $this->themeinfo[$key];
     }
     parent::__construct($serviceManager);
     if ($this->themeinfo['i18n']) {
         ZLanguage::bindThemeDomain($this->name);
         // property for {gt} template plugin to detect language domain
         $this->domain = ZLanguage::getThemeDomain($this->name);
     } else {
         $this->domain = null;
     }
     EventUtil::attachCustomHandlers("themes/{$themeName}/EventHandlers");
     EventUtil::attachCustomHandlers("themes/{$themeName}/lib/{$themeName}/EventHandlers");
     $event = new \Zikula\Core\Event\GenericEvent($this);
     $this->eventManager->dispatch('theme.preinit', $event);
     // change some base settings from our parent class
     // template compilation
     $this->compile_dir = CacheUtil::getLocalDir('Theme_compiled');
     $this->compile_check = ModUtil::getVar('ZikulaThemeModule', 'compile_check');
     $this->force_compile = ModUtil::getVar('ZikulaThemeModule', 'force_compile');
     // template caching
     $this->cache_dir = CacheUtil::getLocalDir('Theme_cache');
     $this->caching = (int) ModUtil::getVar('ZikulaThemeModule', 'enablecache');
     //if ($this->caching) {
     //    $this->cache_modified_check = true;
     //}
     // if caching and is not an admin controller
     if ($this->caching && strpos($this->type, 'admin') !== 0) {
         $modulesnocache = array_filter(explode(',', ModUtil::getVar('ZikulaThemeModule', 'modulesnocache')));
         if (in_array($this->toplevelmodule, $modulesnocache)) {
             $this->caching = Zikula_View::CACHE_DISABLED;
         }
     } else {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     // halt caching for write operations to prevent strange things happening
     if (isset($_POST) && count($_POST) != 0) {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     // and also for GET operations with csrftoken/authkey
     if (isset($_GET['csrftoken']) || isset($_GET['authkey'])) {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     $this->cache_lifetime = ModUtil::getVar('ZikulaThemeModule', 'cache_lifetime');
     if (!$this->homepage) {
         $this->cache_lifetime = ModUtil::getVar('ZikulaThemeModule', 'cache_lifetime_mods');
     }
     // assign all our base template variables
     $this->_base_vars();
     // define the plugin directories
     $this->_plugin_dirs();
     // load the theme configuration
     $this->load_config();
     // check for cached output
     // turn on caching, check for cached output and then disable caching
     // to prevent blocks from being cached
     if ($this->caching && $this->is_cached($this->themeconfig['page'], $this->cache_id)) {
         $this->display($this->themeconfig['page'], $this->cache_id);
         System::shutdown();
     }
     // register page vars output filter
     $this->load_filter('output', 'pagevars');
     // register short urls output filter
     if (System::getVar('shorturls')) {
         $this->load_filter('output', 'shorturls');
     }
     // register trim whitespace output filter if requried
     if (ModUtil::getVar('ZikulaThemeModule', 'trimwhitespace')) {
         $this->load_filter('output', 'trimwhitespace');
     }
     $this->load_filter('output', 'asseturls');
     $event = new \Zikula\Core\Event\GenericEvent($this);
     $this->eventManager->dispatch('theme.init', $event);
     $this->startOutputBuffering();
 }
开发者ID:rmaiwald,项目名称:core,代码行数:87,代码来源:Theme.php

示例4: __construct

 /**
  * Constructs a new instance of pnRender.
  *
  * @param string $module  Name of the module.
  * @param bool   $caching If true, then caching is enabled.
  */
 public function __construct($module = '', $caching = null)
 {
     parent::__construct(ServiceUtil::getManager(), $module, $caching);
     LogUtil::log(__f('Warning! Class %1$s is deprecated. Please use %2$s instead.', array(__CLASS__ , 'Zikula_View')), E_USER_DEPRECATED);
 }
开发者ID:,项目名称:,代码行数:11,代码来源:


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