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


PHP sfException::getTemplatePathForError方法代码示例

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


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

示例1:

<?php

include sfException::getTemplatePathForError('xml', false);
开发者ID:hunde,项目名称:bsc,代码行数:3,代码来源:error.atom.php

示例2: preRenderCheck

 protected function preRenderCheck()
 {
     if (null === $this->template) {
         throw new sfRenderException('A template has not been set.');
     }
     if (!is_readable($this->directory . '/' . $this->template)) {
         if ('404' == $this->context->getResponse()->getStatusCode()) {
             $this->template = sfException::getTemplatePathForError($this->context->getRequest()->getRequestFormat(), false);
             $this->directory = dirname($this->template);
             $this->template = basename($this->template);
             $this->setAttribute('code', '404');
             $this->setAttribute('text', 'Not Found');
         } else {
             throw new sfRenderException(sprintf('The template "%s" does not exist or is unreadable in "%s".', $this->template, $this->directory));
         }
     }
 }
开发者ID:seven07ve,项目名称:vendorepuestos,代码行数:17,代码来源:config_core_compile.yml.php

示例3: preRenderCheck

 /**
  * Executes a basic pre-render check to verify all required variables exist
  * and that the template is readable.
  *
  * @throws sfRenderException If the pre-render check fails
  */
 protected function preRenderCheck()
 {
     if (is_null($this->template)) {
         // a template has not been set
         throw new sfRenderException('A template has not been set.');
     }
     if (!is_readable($this->directory . '/' . $this->template)) {
         // 404?
         if ('404' == $this->context->getResponse()->getStatusCode()) {
             // use default exception templates
             $this->template = sfException::getTemplatePathForError($this->context->getRequest()->getRequestFormat(), false);
             $this->directory = dirname($this->template);
             $this->template = basename($this->template);
             $this->setAttribute('code', '404');
             $this->setAttribute('text', 'Not Found');
         } else {
             throw new sfRenderException(sprintf('The template "%s" does not exist or is unreadable in "%s".', $this->template, $this->directory));
         }
     }
     // check to see if this is a decorator template
     if ($this->decorator && !is_readable($this->decoratorDirectory . '/' . $this->decoratorTemplate)) {
         throw new sfRenderException(sprintf('The decorator template "%s" does not exist or is unreadable in "%s".', $this->decoratorTemplate, $this->decoratorDirectory));
     }
 }
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:30,代码来源:sfView.class.php


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