Development

/branches/1.1/lib/filter/sfRenderingFilter.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/filter/sfRenderingFilter.class.php

Revision 10439, 1.5 kB (checked in by nicolas, 6 years ago)

[1.1] fixed exception cannot be thrown in the sfFormField::__toString method

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfRenderingFilter is the last filter registered for each filter chain. This
13  * filter does the rendering.
14  *
15  * @package    symfony
16  * @subpackage filter
17  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
18  * @version    SVN: $Id$
19  */
20 class sfRenderingFilter extends sfFilter
21 {
22   /**
23    * Executes this filter.
24    *
25    * @param sfFilterChain $filterChain The filter chain.
26    *
27    * @throws <b>sfInitializeException</b> If an error occurs during view initialization
28    * @throws <b>sfViewException</b>       If an error occurs while executing the view
29    */
30   public function execute($filterChain)
31   {
32     // execute next filter
33     $filterChain->execute();
34
35     if (sfConfig::get('sf_logging_enabled'))
36     {
37       $this->context->getEventDispatcher()->notify(new sfEvent($this, 'application.log', array('Render to the client')));
38     }
39
40     // get response object
41     $response = $this->context->getResponse();
42
43     // hack to rethrow sfForm and|or sfFormField __toString() exceptions (see sfForm and sfFormField)
44     if (sfForm::hasToStringException())
45     {
46       throw sfForm::getToStringException();
47     }
48     else if (sfFormField::hasToStringException())
49     {
50       throw sfFormField::getToStringException();
51     }
52
53     // send headers + content
54     $response->send();
55   }
56 }
57
Note: See TracBrowser for help on using the browser.