forked from FriendsOfSymfony1/symfony1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsfRenderingFilter.class.php
50 lines (45 loc) · 1.46 KB
/
sfRenderingFilter.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* sfRenderingFilter is the last filter registered for each filter chain. This
* filter does the rendering.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*
* @version SVN: $Id$
*/
class sfRenderingFilter extends sfFilter
{
/**
* Executes this filter.
*
* @param sfFilterChain $filterChain the filter chain
*
* @throws sfInitializeException If an error occurs during view initialization
* @throws sfViewException If an error occurs while executing the view
*/
public function execute($filterChain)
{
// execute next filter
$filterChain->execute();
// get response object
$response = $this->context->getResponse();
// hack to rethrow sfForm and|or sfFormField __toString() exceptions (see sfForm and sfFormField)
if (sfForm::hasToStringException()) {
throw sfForm::getToStringException();
}
if (sfFormField::hasToStringException()) {
throw sfFormField::getToStringException();
}
// send headers + content
if (sfView::RENDER_VAR != $this->context->getController()->getRenderMode()) {
$response->send();
}
}
}