|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony package. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* For the full copyright and license information, please view the LICENSE |
|
|
9 |
* file that was distributed with this source code. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Component\Templating\Helper; |
|
|
13 |
|
|
|
14 |
/** |
|
|
15 |
* Helper is the base class for all helper classes. |
|
|
16 |
* |
|
|
17 |
* Most of the time, a Helper is an adapter around an existing |
|
|
18 |
* class that exposes a read-only interface for templates. |
|
|
19 |
* |
|
|
20 |
* @author Fabien Potencier <fabien@symfony.com> |
|
|
21 |
* |
|
|
22 |
* @api |
|
|
23 |
*/ |
|
|
24 |
abstract class Helper implements HelperInterface |
|
|
25 |
{ |
|
|
26 |
protected $charset = 'UTF-8'; |
|
|
27 |
|
|
|
28 |
/** |
|
|
29 |
* Sets the default charset. |
|
|
30 |
* |
|
|
31 |
* @param string $charset The charset |
|
|
32 |
* |
|
|
33 |
* @api |
|
|
34 |
*/ |
|
|
35 |
public function setCharset($charset) |
|
|
36 |
{ |
|
|
37 |
$this->charset = $charset; |
|
|
38 |
} |
|
|
39 |
|
|
|
40 |
/** |
|
|
41 |
* Gets the default charset. |
|
|
42 |
* |
|
|
43 |
* @return string The default charset |
|
|
44 |
* |
|
|
45 |
* @api |
|
|
46 |
*/ |
|
|
47 |
public function getCharset() |
|
|
48 |
{ |
|
|
49 |
return $this->charset; |
|
|
50 |
} |
|
|
51 |
} |