|
Revision 3232, 1.8 kB
(checked in by fabien, 6 years ago)
|
updated phpdoc for lib/view directory (based on a patch from Rafael George)
|
- 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 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
class sfPartialView extends sfPHPView |
|---|
| 19 |
{ |
|---|
| 20 |
|
|---|
| 21 |
* Executes any presentation logic for this view. |
|---|
| 22 |
*/ |
|---|
| 23 |
public function execute() |
|---|
| 24 |
{ |
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
* Configures template for this view. |
|---|
| 29 |
*/ |
|---|
| 30 |
public function configure() |
|---|
| 31 |
{ |
|---|
| 32 |
$this->setDecorator(false); |
|---|
| 33 |
|
|---|
| 34 |
$this->setTemplate($this->actionName.$this->getExtension()); |
|---|
| 35 |
if ('global' == $this->moduleName) |
|---|
| 36 |
{ |
|---|
| 37 |
$this->setDirectory(sfConfig::get('sf_app_template_dir')); |
|---|
| 38 |
} |
|---|
| 39 |
else |
|---|
| 40 |
{ |
|---|
| 41 |
$this->setDirectory(sfLoader::getTemplateDir($this->moduleName, $this->getTemplate())); |
|---|
| 42 |
} |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
* Renders the presentation. |
|---|
| 47 |
* |
|---|
| 48 |
* @param array Template attributes |
|---|
| 49 |
* |
|---|
| 50 |
* @return string Current template content |
|---|
| 51 |
*/ |
|---|
| 52 |
public function render($templateVars = array()) |
|---|
| 53 |
{ |
|---|
| 54 |
if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) |
|---|
| 55 |
{ |
|---|
| 56 |
$timer = sfTimerManager::getTimer(sprintf('Partial "%s/%s"', $this->moduleName, $this->actionName)); |
|---|
| 57 |
} |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
$this->preRenderCheck(); |
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
$this->attributeHolder->add($this->getGlobalVars()); |
|---|
| 64 |
$this->attributeHolder->add($templateVars); |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
$retval = $this->renderFile($this->getDirectory().'/'.$this->getTemplate()); |
|---|
| 68 |
|
|---|
| 69 |
if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) |
|---|
| 70 |
{ |
|---|
| 71 |
$timer->addTime(); |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
return $retval; |
|---|
| 75 |
} |
|---|
| 76 |
} |
|---|
| 77 |
|
|---|