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


PHP Zend_View::placeholder方法代码示例

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


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

示例1: _initView

 /**
  * Initialize the view
  *
  * @return Zend_View
  */
 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     // Set doctype and charset
     $view->doctype('XHTML1_TRANSITIONAL');
     $view->placeholder('charset')->set('utf-8');
     // Add the view to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     // Load digitalus helpers
     // base helpers
     $view->addHelperPath('Brightfame/View/Helper', 'Brightfame_View_Helper');
     $view->addHelperPath('Brightfame/Content/Control', 'Brightfame_Content_Control');
     $helperDirs = Brightfame_Directory::getDirectories(BASE_PATH . '/library/Digitalus/View/Helper');
     if (is_array($helperDirs)) {
         foreach ($helperDirs as $dir) {
             $view->addHelperPath(BASE_PATH . '/library/Digitalus/View/Helper/' . $dir, 'Digitalus_View_Helper_' . ucfirst($dir));
         }
     }
     $view->baseUrl = $this->_front->getBaseUrl();
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
开发者ID:robsta,项目名称:brightfamecms,代码行数:29,代码来源:bootstrap.php

示例2: intval

 $update = $_GET['update'];
 $update = intval($update);
 if ($update < 0) {
     $update = 0;
 }
 // update to higher version
 if ($version = $installer->isHigherVersionNumber()) {
     // instantiate updater object
     $pathToConfig = Digitalus_Updater_Version19to110::getConfigPath('old');
     $updater = new Digitalus_Updater_Version19to110($pathToConfig);
     if (Digitalus_Updater_Version19to110::checkVersions($version['new'], $version['old'])) {
         switch ($update) {
             case 0:
             default:
                 $view->installationInformation = $updater->getInstallationInformation();
                 $view->placeholder('form')->set($view->render('update.phtml'));
                 break;
             case 1:
                 try {
                     $updater->run();
                     $view->placeholder('form')->set($view->render('update1.phtml'));
                 } catch (Digitalus_Updater_Exception $e) {
                     $updater->addError('A fatal error while updating the databases occurred!');
                     $updater->addError($e->getMessage());
                 }
                 break;
         }
     } else {
         $updater->addError('You can only update from version ' . Digitalus_Updater_Abstract::getOldVersion() . '!<br />Older versions are not supported!');
     }
 } else {
开发者ID:laiello,项目名称:digitalus-cms,代码行数:31,代码来源:install.php

示例3: preDispatch

 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action_Helper_Abstract::preDispatch()
  */
 public function preDispatch()
 {
     $module = $this->getRequest()->getModuleName();
     $controller = $this->getRequest()->getControllerName();
     $keywords = Settings::findbyParam('default_html_keywords');
     $description = Settings::findbyParam('default_html_description');
     $copyright = Settings::findbyParam('default_copyright');
     // Get the skin paramenter set in the Settings Table in the database
     if ($module == "default") {
         $customskin = Settings::findbyParam('skin');
         $skin = !empty($customskin) && file_exists(PUBLIC_PATH . "/skins/{$module}/{$customskin}") ? $customskin : "blank";
     } elseif ($module == "admin") {
         $customskin = Settings::findbyParam('adminskin');
         $skin = !empty($customskin) && file_exists(PUBLIC_PATH . "/skins/{$module}/{$customskin}") ? $customskin : "blank";
     } else {
         $customskin = "";
         $skin = "";
     }
     // Get all the resources set in the layout.xml file
     $css = Shineisp_Commons_Layout::getResources($module, $controller, "css", $skin);
     $js = Shineisp_Commons_Layout::getResources($module, $controller, "js", $skin);
     $template = Shineisp_Commons_Layout::getTemplate($module, $controller, $skin);
     // Setting up the HEAD Section
     $view = new Zend_View();
     $view->doctype('XHTML1_TRANSITIONAL');
     #$view->headMeta ()->appendHttpEquiv ( 'Content-Type', 'text/html;charset=utf-8' );
     $view->headTitle(Settings::findbyParam('default_html_title'));
     $view->headMeta()->setName('robots', "INDEX, FOLLOW");
     $view->headMeta()->setName('author', !empty($copyright) ? $copyright : "Shine Software Company");
     $view->headMeta()->setName('keywords', !empty($keywords) ? $keywords : "shine software, isp software");
     $view->headMeta()->setName('description', !empty($description) ? $description : "This is a Shine Software application");
     $view->headTitle()->setSeparator(' / ');
     // Custom XML file inclusion of the js files
     if (!empty($js)) {
         // Fast including of the js file using the module name
         if (file_exists(PUBLIC_PATH . "/skins/{$module}/{$skin}/js/{$module}.js")) {
             $js[] = array('resource' => "/skins/{$module}/{$skin}/js/{$module}.js", 'position' => 'admin_endbody');
         }
         // Fast including of the js file for the controller
         if (file_exists(PUBLIC_PATH . "/skins/{$module}/{$skin}/js/{$controller}.js")) {
             $js[] = array('resource' => "/skins/{$module}/{$skin}/js/{$controller}.js", "position" => 'admin_endbody');
         }
         // Check the caches administrator preferences
         if (Settings::findbyParam('jscompression')) {
             @mkdir(PUBLIC_PATH . "/cache/");
             // Create the JS Compressor object
             $compressor = new Shineisp_Commons_jsCompressor();
             foreach ($js as $item) {
                 $compressor->add(PUBLIC_PATH . $item['resource']);
             }
             // Compress and minify the javascript files
             $filecompressed = $compressor->simpleMode()->hideDebugInfo()->cacheDir(PUBLIC_PATH . "/cache/")->write();
             $deferringjs = "<script>(function() { var s = document.createElement(\"script\"); s.type = \"text/javascript\"; s.async = true; s.src = \"/cache/{$filecompressed}\"; var x = document.getElementsByTagName(\"script\")[0]; x.parentNode.insertBefore(s, x) })();</script>";
             // Add the compressed file in the deferring mode
             if ($module == "admin") {
                 $view->placeholder("admin_htmlhead")->append($deferringjs);
             } elseif ($module == "default") {
                 $view->placeholder("htmlhead")->append($deferringjs);
             }
         } else {
             foreach ($js as $item) {
                 // check if the css or the js is a conditional item
                 $conditional = !empty($item['conditional']) ? array('conditional' => $item['conditional']) : null;
                 // check the position of the item in the page
                 if (!empty($item['position'])) {
                     $view->InlineScript()->setFile($item['resource'], 'text/javascript', $conditional)->toString();
                     $view->placeholder($item['position'])->append($view->InlineScript()->toString());
                 } else {
                     $view->headScript()->setFile($item['resource'], 'text/javascript', $conditional);
                     $view->placeholder("admin_endbody")->append($view->InlineScript()->toString());
                 }
             }
         }
     }
     // Custom XML file inclusion of the css files
     if (!empty($css)) {
         // Fast including of the css file using the module name
         if (file_exists(PUBLIC_PATH . "/skins/{$module}/{$skin}/css/{$module}.css")) {
             $css[]['resource'] = "/skins/{$module}/{$skin}/css/{$module}.css";
         }
         // Fast including of the css file for the controller
         if (file_exists(PUBLIC_PATH . "/skins/{$module}/{$skin}/css/{$controller}.css")) {
             $css[]['resource'] = "/skins/{$module}/{$skin}/css/{$controller}.css";
         }
         // Check the caches administrator preferences
         if (Settings::findbyParam('csscompression')) {
             @mkdir(PUBLIC_PATH . "/cache/");
             // Create the JS Compressor object
             $compressor = new Shineisp_Commons_cssCompressor();
             foreach ($css as $item) {
                 $compressor->add(PUBLIC_PATH . $item['resource']);
             }
             // Compress and minify the stylesheet files
             $filecompressed = $compressor->cacheDir(PUBLIC_PATH . "/cache/")->write();
             $view->headLink()->appendStylesheet("/cache/{$filecompressed}");
         } else {
//.........这里部分代码省略.........
开发者ID:kokkez,项目名称:shineisp,代码行数:101,代码来源:LayoutLoader.php

示例4: _initView

 /**
  * Initialize the view
  *
  * @return Zend_View
  */
 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     $this->bootstrap('siteSettings');
     // Get settings resource
     $settings = $this->getResource('siteSettings');
     // Set doctype and charset
     $view->doctype($settings->get('doc_type'));
     $view->placeholder('charset')->set($settings->get('default_charset'));
     $view->addFilterPath('Digitalus/View/Filter', 'Digitalus_View_Filter');
     $view->setFilter('Translate');
     // Add the view to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     // base helpers
     $view->addHelperPath('Digitalus/View/Helper', 'Digitalus_View_Helper');
     $view->addHelperPath('Digitalus/Content/Control', 'Digitalus_Content_Control');
     // Load digitalus helpers
     $helperDirs = Digitalus_Filesystem_Dir::getDirectories(BASE_PATH . '/library/Digitalus/View/Helper');
     if (is_array($helperDirs)) {
         foreach ($helperDirs as $dir) {
             $view->addHelperPath(BASE_PATH . '/library/Digitalus/View/Helper/' . $dir, 'Digitalus_View_Helper_' . ucfirst($dir));
         }
     }
     $view->baseUrl = $this->_front->getBaseUrl();
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
开发者ID:laiello,项目名称:digitalus-cms,代码行数:34,代码来源:Bootstrap.php


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