[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/view/ -> sfPartialView.class.php (source)

   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: sfPartialView.class.php 3232 2007-01-11 20:51:54Z fabien $
  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  }


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7