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


PHP Zend_View_Interface::baseUrl方法代码示例

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


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

示例1: profileLink

 public function profileLink()
 {
     $baseUrl = $this->view->baseUrl();
     $auth = Zend_Auth::getInstance();
     $html = '<a href="' . $baseUrl . '/user/login"> Login </a>';
     if ($auth->hasIdentity()) {
         $html = '<a href="' . $baseUrl . '/user/logout"> Logout </a>';
     }
     return $html;
 }
开发者ID:modulexcite,项目名称:zfopenid,代码行数:10,代码来源:ProfileLink.php

示例2: loginLink

 /**
  * Returns the login or logout link.
  * @return string $link
  */
 public function loginLink()
 {
     // get the auth object
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $link = '<a href="' . $this->view->baseUrl('/auth/login/logout') . '">Logout</a>';
     } else {
         // user not logged in, display the login link
         $path = $this->view->path();
         if (strpos($path, '/core/layout') === false) {
             $link = '<a href="' . $this->view->baseUrl('/auth/login?redirect=' . $path) . '">Login</a>';
         } else {
             $link = '<a href="' . $this->view->baseUrl('/auth/login') . '">Login</a>';
         }
     }
     return $link;
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:21,代码来源:LoginLink.php

示例3: headStatic

 /**
  * Produces the HTML header by adding the required JS and CSS script to the view. 
  * These are the files necessary for Daiquiri to work as defined in $_files and any
  * additional file given in $inputfiles. If minify is enabled in the configuration 
  * file, the JS and CSS files are minified.
  * @param  array  $customFiles   additional static files
  * @param  array  $overrideFiles files that override the default files
  */
 public function headStatic(array $customFiles, array $overrideFiles = array())
 {
     $hl = $this->view->headLink();
     $hs = $this->view->headScript();
     $js = array();
     $css = array();
     if (Daiquiri_Config::getInstance()->core->minify->enabled == true) {
         $js[] = 'min/js/daiquiri.js';
         $css[] = 'min/css/daiquiri.css';
     } else {
         foreach (Daiquiri_View_Helper_HeadStatic::$files as $key => $file) {
             if (array_key_exists($key, $overrideFiles)) {
                 $file = $overrideFiles[$key];
             }
             $ext = pathinfo($file, PATHINFO_EXTENSION);
             if ($ext === 'js') {
                 $js[] = $file;
             } else {
                 if ($ext === 'css') {
                     $css[] = $file;
                 }
             }
         }
     }
     foreach ($customFiles as $file) {
         $ext = pathinfo($file, PATHINFO_EXTENSION);
         if ($ext === 'js') {
             $js[] = $file;
         } else {
             if ($ext === 'css') {
                 $css[] = $file;
             }
         }
     }
     // prepend files in reverse order
     foreach (array_reverse($css) as $file) {
         $hl->prependStylesheet($this->view->baseUrl($file));
     }
     foreach (array_reverse($js) as $file) {
         $hs->prependFile($this->view->baseUrl($file));
     }
     // echo the view helpers
     echo PHP_EOL . PHP_EOL . $hl . PHP_EOL . PHP_EOL . $hs . PHP_EOL . PHP_EOL;
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:52,代码来源:HeadStatic.php

示例4: setView

 public function setView(Zend_View_Interface $view)
 {
     $this->view = $view;
     $this->_baseUrl = $this->view->baseUrl();
 }
开发者ID:shrekuu,项目名称:bundle-phu,代码行数:5,代码来源:BundleLink.php


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