|
Revision 23332, 0.6 kB
(checked in by geoffrey, 4 years ago)
|
[sfTemplatingViewPlugin] initial import
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
class sfTemplatingView extends sfPHPView |
|---|
| 4 |
{ |
|---|
| 5 |
protected $engine; |
|---|
| 6 |
|
|---|
| 7 |
public function execute() |
|---|
| 8 |
{ |
|---|
| 9 |
$loader = new sfTemplateLoaderFilesystem(sfConfig::get('sf_root_dir').'/%name%'); |
|---|
| 10 |
$this->engine = new sfTemplateEngine($loader); |
|---|
| 11 |
} |
|---|
| 12 |
|
|---|
| 13 |
public function getEngine() |
|---|
| 14 |
{ |
|---|
| 15 |
return $this->engine; |
|---|
| 16 |
} |
|---|
| 17 |
|
|---|
| 18 |
public function renderFile($_sfFile) |
|---|
| 19 |
{ |
|---|
| 20 |
if (sfConfig::get('sf_logging_enabled')) |
|---|
| 21 |
{ |
|---|
| 22 |
$this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Render "%s"', $_sfFile)))); |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
$this->loadCoreAndStandardHelpers(); |
|---|
| 26 |
|
|---|
| 27 |
return $this->getEngine()->render($_sfFile, $this->attributeHolder->toArray()); |
|---|
| 28 |
} |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|