• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_View_Exception类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: htmlList

 /**
  * Generates a 'List' element.
  *
  * @param array   $items   Array with the elements of the list
  * @param boolean $ordered Specifies ordered/unordered list; default unordered
  * @param array   $attribs Attributes for the ol/ul tag.
  * @return string The list XHTML.
  */
 public function htmlList(array $items, $ordered = false, $attribs = false, $escape = true)
 {
     if (!is_array($items)) {
         #require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('First param must be an array');
         $e->setView($this->view);
         throw $e;
     }
     $list = '';
     foreach ($items as $item) {
         if (!is_array($item)) {
             if ($escape) {
                 $item = $this->view->escape($item);
             }
             $list .= '<li>' . $item . '</li>' . self::EOL;
         } else {
             if (6 < strlen($list)) {
                 $list = substr($list, 0, strlen($list) - 6) . $this->htmlList($item, $ordered, $attribs, $escape) . '</li>' . self::EOL;
             } else {
                 $list .= '<li>' . $this->htmlList($item, $ordered, $attribs, $escape) . '</li>' . self::EOL;
             }
         }
     }
     if ($attribs) {
         $attribs = $this->_htmlAttribs($attribs);
     } else {
         $attribs = '';
     }
     $tag = 'ul';
     if ($ordered) {
         $tag = 'ol';
     }
     return '<' . $tag . $attribs . '>' . self::EOL . $list . '</' . $tag . '>' . self::EOL;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:42,代码来源:HtmlList.php


示例2: __construct

    /**
     * Constructor
     *
     * Grab local copies of various MVC objects
     *
     * @return void
     */
    public function __construct()
    {
        $front   = Zend_Controller_Front::getInstance();
        $modules = $front->getControllerDirectory();
        if (empty($modules)) {
            // require_once 'Zend/View/Exception.php';
            $e = new Zend_View_Exception('Action helper depends on valid front controller instance');
            $e->setView($this->view);
            throw $e;
        }

        $request  = $front->getRequest();
        $response = $front->getResponse();

        if (empty($request) || empty($response)) {
            // require_once 'Zend/View/Exception.php';
            $e = new Zend_View_Exception('Action view helper requires both a registered request and response object in the front controller instance');
            $e->setView($this->view);
            throw $e;
        }

        $this->request       = clone $request;
        $this->response      = clone $response;
        $this->dispatcher    = clone $front->getDispatcher();
        $this->defaultModule = $front->getDefaultModule();
    }
开发者ID:padraic,项目名称:framework-benchs,代码行数:33,代码来源:Action.php


示例3: findHelper

 public function findHelper($proxy, $strict = true)
 {
     if (isset($this->_helpers[$proxy])) {
         return $this->_helpers[$proxy];
     }
     if (!$this->view->getPluginLoader('helper')->getPaths(self::NS)) {
         $this->view->addHelperPath(str_replace('_', '/', self::NS), self::NS);
     }
     if ($strict) {
         $helper = $this->view->getHelper($proxy);
     } else {
         try {
             $helper = $this->view->getHelper($proxy);
         } catch (Zend_Loader_PluginLoader_Exception $e) {
             return null;
         }
     }
     if (!$helper instanceof Zend_View_Helper_Navigation_Helper) {
         if ($strict) {
             require_once 'Zend/View/Exception.php';
             $e = new Zend_View_Exception(sprintf('Proxy helper "%s" is not an instance of ' . 'Zend_View_Helper_Navigation_Helper', get_class($helper)));
             $e->setView($this->view);
             throw $e;
         }
         return null;
     }
     $this->_inject($helper);
     $this->_helpers[$proxy] = $helper;
     return $helper;
 }
开发者ID:netconstructor,项目名称:Centurion,代码行数:30,代码来源:Navigation.php


示例4: __set

 public function __set($key, $val)
 {
     if ('_' != substr($key, 0, 1)) {
         $this->_proxyData->{$key} = $val;
         return;
     }
     require_once 'Zend/View/Exception.php';
     $e = new Zend_View_Exception('Setting private or protected class members is not allowed');
     $e->setView($this);
     throw $e;
 }
开发者ID:padraic,项目名称:ZFPlanet,代码行数:11,代码来源:View.php


示例5: setTranslator

 /**
  * Set translator
  *
  * @param  Zend_Translate|Zend_Translate_Adapter|null $translator
  * @return Zend_View_Helper_FormElement
  */
 public function setTranslator($translator = null)
 {
     if (null === $translator) {
         $this->_translator = null;
     } elseif ($translator instanceof Zend_Translate_Adapter) {
         $this->_translator = $translator;
     } elseif ($translator instanceof Zend_Translate) {
         $this->_translator = $translator->getAdapter();
     } else {
         $e = new Zend_View_Exception('Invalid translator specified');
         $e->setView($this->view);
         throw $e;
     }
     return $this;
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:21,代码来源:FormElement.php


示例6: doctype

    /**
     * Set or retrieve doctype
     *
     * @param  string $doctype
     * @return Zend_View_Helper_Doctype
     */
    public function doctype($doctype = null)
    {
        if (null !== $doctype) {
            switch ($doctype) {
                case self::XHTML11:
                case self::XHTML1_STRICT:
                case self::XHTML1_TRANSITIONAL:
                case self::XHTML1_FRAMESET:
                case self::XHTML_BASIC1:
                case self::XHTML1_RDFA:
                case self::XHTML5:
                case self::HTML4_STRICT:
                case self::HTML4_LOOSE:
                case self::HTML4_FRAMESET:
                case self::HTML5:
                    $this->setDoctype($doctype);
                    break;
                default:
                    if (substr($doctype, 0, 9) != '<!DOCTYPE') {
                        require_once 'Zend/View/Exception.php';
                        $e = new Zend_View_Exception('The specified doctype is malformed');
                        $e->setView($this->view);
                        throw $e;
                    }
                    if (stristr($doctype, 'xhtml')) {
                        $type = self::CUSTOM_XHTML;
                    } else {
                        $type = self::CUSTOM;
                    }
                    $this->setDoctype($type);
                    $this->_registry['doctypes'][$type] = $doctype;
                    break;
            }
        }

        return $this;
    }
开发者ID:realfluid,项目名称:umbaugh,代码行数:43,代码来源:Doctype.php


示例7: offsetSet

 /**
  * Override offsetSet
  *
  * @param  string|int $index
  * @param  mixed $value
  * @return void
  */
 public function offsetSet($index, $value)
 {
     if (!$this->_isValid($value)) {
         //require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('Invalid argument passed to offsetSet(); please use one of the helper methods, offsetSetScript() or offsetSetFile()');
         $e->setView($this->view);
         throw $e;
     }
     return $this->getContainer()->offsetSet($index, $value);
 }
开发者ID:schlypel,项目名称:YiiBackboneBoilerplate,代码行数:17,代码来源:HeadScript.php


示例8: createDataAlternate

 /**
  * Create item for alternate link item
  *
  * @param  array $args
  * @return stdClass
  */
 public function createDataAlternate(array $args)
 {
     if (3 > count($args)) {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception(sprintf('Alternate tags require 3 arguments; %s provided', count($args)));
         $e->setView($this->view);
         throw $e;
     }
     $rel = 'alternate';
     $href = array_shift($args);
     $type = array_shift($args);
     $title = array_shift($args);
     if (0 < count($args) && is_array($args[0])) {
         $extras = array_shift($args);
         $extras = (array) $extras;
         if (isset($extras['media']) && is_array($extras['media'])) {
             $extras['media'] = implode(',', $extras['media']);
         }
     }
     $href = (string) $href;
     $type = (string) $type;
     $title = (string) $title;
     $attributes = compact('rel', 'href', 'type', 'title', 'extras');
     return $this->createData($attributes);
 }
开发者ID:madberry,项目名称:WhiteLabelTransfer,代码行数:31,代码来源:HeadLink.php


示例9: getLocale

 /**
  * Returns the set locale for translations
  *
  * @throws Zend_View_Exception When no Zend_Translate instance was set
  * @return string|Zend_Locale
  */
 public function getLocale()
 {
     $translate = $this->getTranslator();
     if ($translate === null) {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter');
         $e->setView($this->view);
         throw $e;
     }
     return $translate->getLocale();
 }
开发者ID:fredcido,项目名称:cenbrap,代码行数:17,代码来源:Translate.php


示例10: paginationControl

 /**
  * Render the provided pages.  This checks if $view->paginator is set and,
  * if so, uses that.  Also, if no scrolling style or partial are specified,
  * the defaults will be used (if set).
  *
  * @param  Zend_Paginator (Optional) $paginator
  * @param  string $scrollingStyle (Optional) Scrolling style
  * @param  string $partial (Optional) View partial
  * @param  array|string $params (Optional) params to pass to the partial
  * @return string
  * @throws Zend_View_Exception
  */
 public function paginationControl(Zend_Paginator $paginator = null, $scrollingStyle = null, $partial = null, $params = null)
 {
     if ($paginator === null) {
         if (isset($this->view->paginator) and $this->view->paginator !== null and $this->view->paginator instanceof Zend_Paginator) {
             $paginator = $this->view->paginator;
         } else {
             /**
              * @see Zend_View_Exception
              */
             require_once 'Zend/View/Exception.php';
             $e = new Zend_View_Exception('No paginator instance provided or incorrect type');
             $e->setView($this->view);
             throw $e;
         }
     }
     if ($partial === null) {
         if (self::$_defaultViewPartial === null) {
             /**
              * @see Zend_View_Exception
              */
             require_once 'Zend/View/Exception.php';
             $e = new Zend_View_Exception('No view partial provided and no default set');
             $e->setView($this->view);
             throw $e;
         }
         $partial = self::$_defaultViewPartial;
     }
     $pages = get_object_vars($paginator->getPages($scrollingStyle));
     if ($params !== null) {
         $pages = array_merge($pages, (array) $params);
     }
     if (is_array($partial)) {
         if (count($partial) != 2) {
             /**
              * @see Zend_View_Exception
              */
             require_once 'Zend/View/Exception.php';
             $e = new Zend_View_Exception('A view partial supplied as an array must contain two values: the filename and its module');
             $e->setView($this->view);
             throw $e;
         }
         if ($partial[1] !== null) {
             return $this->view->partial($partial[0], $partial[1], $pages);
         }
         $partial = $partial[0];
     }
     return $this->view->partial($partial, $pages);
 }
开发者ID:null-1,项目名称:fangtaitong,代码行数:60,代码来源:PaginationControl.php


示例11: set

 /**
  * Override set to enforce style creation
  *
  * @param  mixed $value
  * @return void
  */
 public function set($value)
 {
     if (!$this->_isValid($value)) {
         // require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('Invalid value passed to set; please use setStyle()');
         $e->setView($this->view);
         throw $e;
     }
     return $this->getContainer()->set($value);
 }
开发者ID:sadikeser,项目名称:tickets,代码行数:16,代码来源:HeadStyle.php


示例12: renderPartial

 /**
  * Renders the given $container by invoking the partial view helper
  *
  * The container will simply be passed on as a model to the view script
  * as-is, and will be available in the partial script as 'container', e.g.
  * <code>echo 'Number of pages: ', count($this->container);</code>.
  *
  * @param  Zend_Navigation_Container $container  [optional] container to
  *                                               pass to view script. Default
  *                                               is to use the container
  *                                               registered in the helper.
  * @param  string|array             $partial     [optional] partial view
  *                                               script to use. Default is to
  *                                               use the partial registered
  *                                               in the helper. If an array
  *                                               is given, it is expected to
  *                                               contain two values; the
  *                                               partial view script to use,
  *                                               and the module where the
  *                                               script can be found.
  * @return string                                helper output
  */
 public function renderPartial(Zend_Navigation_Container $container = null, $partial = null)
 {
     if (null === $container) {
         $container = $this->getContainer();
     }
     if (null === $partial) {
         $partial = $this->getPartial();
     }
     if (empty($partial)) {
         $e = new Zend_View_Exception('Unable to render menu: No partial view script provided');
         $e->setView($this->view);
         throw $e;
     }
     $model = array('container' => $container);
     if (is_array($partial)) {
         if (count($partial) != 2) {
             $e = new Zend_View_Exception('Unable to render menu: A view partial supplied as ' . 'an array must contain two values: partial view ' . 'script and module where script can be found');
             $e->setView($this->view);
             throw $e;
         }
         return $this->view->partial($partial[0], $partial[1], $model);
     }
     return $this->view->partial($partial, null, $model);
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:46,代码来源:Menu.php


示例13: getPluginLoader

 /**
  * Retrieve plugin loader for a specific plugin type
  *
  * @param  string $type
  * @return Zend_Loader_PluginLoader
  */
 public function getPluginLoader($type)
 {
     $type = strtolower($type);
     if (!in_array($type, $this->_loaderTypes)) {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception(sprintf('Invalid plugin loader type "%s"; cannot retrieve', $type));
         $e->setView($this);
         throw $e;
     }
     if (!array_key_exists($type, $this->_loaders)) {
         $prefix = 'Zend_View_';
         $pathPrefix = 'Zend/View/';
         $pType = ucfirst($type);
         switch ($type) {
             case 'filter':
             case 'helper':
             default:
                 $prefix .= $pType;
                 $pathPrefix .= $pType;
                 $loader = new Centurion_Loader_PluginLoader(array($prefix => $pathPrefix), $type);
                 $this->_loaders[$type] = $loader;
                 break;
         }
     }
     return $this->_loaders[$type];
 }
开发者ID:netconstructor,项目名称:Centurion,代码行数:32,代码来源:View.php


示例14: _script

 /**
  * Finds a view script from the available directories.
  *
  * @param string $name The base name of the script.
  * @return void
  */
 protected function _script($name)
 {
     if ($this->isLfiProtectionOn() && preg_match('#\\.\\.[\\\\/]#', $name)) {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('Requested scripts may not include parent directory traversal ("../", "..\\" notation)');
         $e->setView($this);
         throw $e;
     }
     if (0 == count($this->_path['script'])) {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('no view script directory set; unable to determine location for view script');
         $e->setView($this);
         throw $e;
     }
     /* original
        foreach ($this->_path['script'] as $dir) {
            if (is_readable($dir . $name)) {
                return $dir . $name;
            }
        }
        */
     // alcalbg: layout conflict detector
     $count = 0;
     $ret = $ret_log = false;
     foreach ($this->_path['script'] as $dir) {
         if (is_readable($dir . $name)) {
             if ($ret === false) {
                 $ret = $dir . $name;
             }
             $ret_log = $dir . $name;
             ++$count;
         }
     }
     if ($count > 2) {
         foreach ($this->_path['script'] as $dir) {
             if ($dir . $name != $ret_log && is_readable($dir . $name)) {
                 $message = 'Possible layout conflict: ' . $dir . $name;
                 Application_Plugin_Common::log($message);
             }
         }
     }
     if ($ret) {
         return $ret;
     }
     // alcalbg: end
     require_once 'Zend/View/Exception.php';
     $message = "script '{$name}' not found in path (" . implode(PATH_SEPARATOR, $this->_path['script']) . ")";
     $e = new Zend_View_Exception($message);
     $e->setView($this);
     throw $e;
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:57,代码来源:Abstract.php


示例15: offsetSet

 /**
  * Override offsetSet
  *
  * @param  string|int $index
  * @param  mixed $value
  * @return void
  */
 public function offsetSet($index, $value)
 {
     if (!$this->_isValid($value)) {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('Invalid argument passed to offsetSet(); please use one of the helper methods, offsetSetScript() or offsetSetFile()');
         $e->setView($this->view);
         throw $e;
     }
     // we don't need to overwrite existing files - will shift them by one
     if ($this->getContainer()->offsetExists($index)) {
         $values = $this->getContainer()->getArrayCopy();
         $keys = $this->getContainer()->getKeys();
         // insert value to required position. Keys will be restored later
         $offset = array_search($index, $keys);
         array_splice($values, $offset, 0, array($value));
         // rebuild array keys
         $arrKeys = array_fill_keys($keys, null);
         $result = array();
         foreach ($arrKeys as $key => $dummy) {
             if ($key === $index) {
                 do {
                     $result[$key] = $dummy;
                     $key++;
                 } while (isset($keys[$key]));
             }
             $result[$key] = $dummy;
         }
         // restore keys in result array
         $i = 0;
         foreach ($result as $key => $dummy) {
             $result[$key] = $values[$i++];
         }
         return $this->getContainer()->exchangeArray($result);
     }
     return $this->getContainer()->offsetSet($index, $value);
 }
开发者ID:baisoo,项目名称:axiscommerce,代码行数:43,代码来源:HeadScript.php


示例16: renderLink

    /**
     * Renders the given $page as a link element, with $attrib = $relation
     *
     * @param  Zend_Navigation_Page $page      the page to render the link for
     * @param  string               $attrib    the attribute to use for $type,
     *                                         either 'rel' or 'rev'
     * @param  string               $relation  relation type, muse be one of;
     *                                         alternate, appendix, bookmark,
     *                                         chapter, contents, copyright,
     *                                         glossary, help, home, index, next,
     *                                         prev, section, start, stylesheet,
     *                                         subsection
     * @return string                          rendered link element
     * @throws Zend_View_Exception             if $attrib is invalid
     */
    public function renderLink(Zend_Navigation_Page $page, $attrib, $relation)
    {
        if (!in_array($attrib, array('rel', 'rev'))) {
            require_once 'Zend/View/Exception.php';
            $e = new Zend_View_Exception(sprintf(
                    'Invalid relation attribute "%s", must be "rel" or "rev"',
                    $attrib));
            $e->setView($this->view);
            throw $e;
        }

        if (!$href = $page->getHref()) {
            return '';
        }

        // TODO: add more attribs
        // http://www.w3.org/TR/html401/struct/links.html#h-12.2
        $attribs = array(
            $attrib  => $relation,
            'href'   => $href,
            'title'  => $page->getLabel()
        );

        return '<link' .
               $this->_htmlAttribs($attribs) .
               $this->getClosingBracket();
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:42,代码来源:Links.php


示例17: setRole

 /**
  * Sets ACL role(s) to use when iterating pages
  *
  * Implements {@link Zend_View_Helper_Navigation_Helper::setRole()}.
  *
  * @param  mixed $role                                 [optional] role to
  *                                                     set. Expects a string,
  *                                                     an instance of type
  *                                                     {@link Zend_Acl_Role_Interface},
  *                                                     or null. Default is
  *                                                     null, which will set
  *                                                     no role.
  * @throws Zend_View_Exception                         if $role is invalid
  * @return Zend_View_Helper_Navigation_HelperAbstract  fluent interface,
  *                                                     returns self
  */
 public function setRole($role = null)
 {
     if (null === $role || is_string($role) || $role instanceof Zend_Acl_Role_Interface) {
         $this->_role = $role;
     } else {
         #require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception(sprintf('$role must be a string, null, or an instance of ' . 'Zend_Acl_Role_Interface; %s given', gettype($role)));
         $e->setView($this->view);
         throw $e;
     }
     return $this;
 }
开发者ID:ankitsapient,项目名称:testgithubankit,代码行数:28,代码来源:HelperAbstract.php


示例18: getDomSitemap

    /**
     * Returns a DOMDocument containing the Sitemap XML for the given container
     *
     * @param  Zend_Navigation_Container $container  [optional] container to get
     *                                               breadcrumbs from, defaults
     *                                               to what is registered in the
     *                                               helper
     * @return DOMDocument                           DOM representation of the
     *                                               container
     * @throws Zend_View_Exception                   if schema validation is on
     *                                               and the sitemap is invalid
     *                                               according to the sitemap
     *                                               schema, or if sitemap
     *                                               validators are used and the
     *                                               loc element fails validation
     */
    public function getDomSitemap(Zend_Navigation_Container $container = null)
    {
        if (null === $container) {
            $container = $this->getContainer();
        }

        // check if we should validate using our own validators
        if ($this->getUseSitemapValidators()) {
            require_once 'Zend/Validate/Sitemap/Changefreq.php';
            require_once 'Zend/Validate/Sitemap/Lastmod.php';
            require_once 'Zend/Validate/Sitemap/Loc.php';
            require_once 'Zend/Validate/Sitemap/Priority.php';

            // create validators
            $locValidator        = new Zend_Validate_Sitemap_Loc();
            $lastmodValidator    = new Zend_Validate_Sitemap_Lastmod();
            $changefreqValidator = new Zend_Validate_Sitemap_Changefreq();
            $priorityValidator   = new Zend_Validate_Sitemap_Priority();
        }

        // create document
        $dom = new DOMDocument('1.0', 'UTF-8');
        $dom->formatOutput = $this->getFormatOutput();

        // ...and urlset (root) element
        $urlSet = $dom->createElementNS(self::SITEMAP_NS, 'urlset');
        $dom->appendChild($urlSet);

        // create iterator
        $iterator = new RecursiveIteratorIterator($container,
            RecursiveIteratorIterator::SELF_FIRST);

        $maxDepth = $this->getMaxDepth();
        if (is_int($maxDepth)) {
            $iterator->setMaxDepth($maxDepth);
        }
        $minDepth = $this->getMinDepth();
        if (!is_int($minDepth) || $minDepth < 0) {
            $minDepth = 0;
        }

        // iterate container
        foreach ($iterator as $page) {
            if ($iterator->getDepth() < $minDepth || !$this->accept($page)) {
                // page should not be included
                continue;
            }

            // get absolute url from page
            if (!$url = $this->url($page)) {
                // skip page if it has no url (rare case)
                continue;
            }

            // create url node for this page
            $urlNode = $dom->createElementNS(self::SITEMAP_NS, 'url');
            $urlSet->appendChild($urlNode);

            if ($this->getUseSitemapValidators() &&
                !$locValidator->isValid($url)) {
                require_once 'Zend/View/Exception.php';
                $e = new Zend_View_Exception(sprintf(
                        'Encountered an invalid URL for Sitemap XML: "%s"',
                        $url));
                $e->setView($this->view);
                throw $e;
            }

            // put url in 'loc' element
            $urlNode->appendChild($dom->createElementNS(self::SITEMAP_NS,
                                                        'loc', $url));

            // add 'lastmod' element if a valid lastmod is set in page
            if (isset($page->lastmod)) {
                $lastmod = strtotime((string) $page->lastmod);

                // prevent 1970-01-01...
                if ($lastmod !== false) {
                    $lastmod = date('c', $lastmod);
                }

                if (!$this->getUseSitemapValidators() ||
                    $lastmodValidator->isValid($lastmod)) {
                    $urlNode->appendChild(
//.........这里部分代码省略.........
开发者ID:nhp,项目名称:shopware-4,代码行数:101,代码来源:Sitemap.php


示例19: setTranslator

 /**
  * Sets a translation Adapter for translation
  *
  * @param  Zend_Translate|Zend_Translate_Adapter $translate
  * @return Zend_View_Helper_HeadTitle
  */
 public function setTranslator($translate)
 {
     if ($translate instanceof Zend_Translate_Adapter) {
         $this->_translator = $translate;
     } elseif ($translate instanceof Zend_Translate) {
         $this->_translator = $translate->getAdapter();
     } else {
         require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception("You must set an instance of Zend_Translate or Zend_Translate_Adapter");
         $e->setView($this->view);
         throw $e;
     }
     return $this;
 }
开发者ID:conectapb,项目名称:sysagroweb,代码行数:20,代码来源:HeadTitle.php


示例20: renderPartial

 /**
  * Renders the given $container by invoking the partial view helper
  *
  * The container will simply be passed on as a model to the view script,
  * so in the script it will be available in <code>$this->container</code>.
  *
  * @param  Zend_Navigation_Container $container  [optional] container to
  *                                               pass to view script.
  *                                               Default is to use the
  *                                               container registered in the
  *                                               helper.
  * @param  string|array             $partial     [optional] partial view
  *                                               script to use. Default is
  *                                               to use the partial
  *                                               registered in the helper.
  *                                               If an array is given, it is
  *                                               expected to contain two
  *                                               values; the partial view
  *                                               script to use, and the
  *                                               module where the script can
  *                                               be found.
  * @return string                                helper output
  */
 public function renderPartial(Zend_Navigation_Container $container = null, $partial = null)
 {
     if (null === $container) {
         $container = $this->getContainer();
     }
     if (null === $partial) {
         $partial = $this->getPartial();
     }
     if (empty($partial)) {
         //--//require_once 'Zend/View/Exception.php';
         $e = new Zend_View_Exception('Unable to render menu: No partial view script provided');
         $e->setView($this->view);
         throw $e;
     }
     // put breadcrumb pages in model
     $model = array('pages' => array());
     if ($active = $this->findActive($container)) {
         $active = $active['page'];
         $model['pages'][] = $active;
         while ($parent = $active->getParent()) {
             if ($parent instanceof Zend_Navigation_Page) {
                 $model['pages'][] = $parent;
             } else {
                 break;
             }
             if ($parent === $container) {
                 // break if at the root of the given container
                 break;
             }
             $active = $parent;
         }
         $model['pages'] = array_reverse($model['pages']);
     }
     if (is_array($partial)) {
         if (count($partial) != 2) {
             //--//require_once 'Zend/View/Exception.php';
             $e = new Zend_View_Exception('Unable to render menu: A view partial supplied as ' . 'an array must contain two values: partial view ' . 'script and module where script can be found');
             $e->setView($this->view);
             throw $e;
         }
         return $this->view->partial($partial[0], $partial[1], $model);
     }
     return $this->view->partial($partial, null, $model);
 }
开发者ID:irovast,项目名称:eyedock,代码行数:67,代码来源:Breadcrumbs.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_View_Helper_HtmlElement类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_View_Abstract类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap