Development

/branches/1.0/lib/view/sfPartialView.class.php

You must first sign up to be able to contribute.

root/branches/1.0/lib/view/sfPartialView.class.php

Revision 3232, 1.8 kB (checked in by fabien, 7 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  * 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  *
13  * @package    symfony
14  * @subpackage view
15  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
16  * @version    SVN: $Id$
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     // execute pre-render check
60     $this->preRenderCheck();
61
62     // assigns some variables to the template
63     $this->attributeHolder->add($this->getGlobalVars());
64     $this->attributeHolder->add($templateVars);
65
66     // render template
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
Note: See TracBrowser for help on using the browser.