Development

Changeset 5813

You must first sign up to be able to contribute.

Changeset 5813

Show
Ignore:
Timestamp:
11/02/07 16:46:14 (10 months ago)
Author:
fabien
Message:

added a module argument to sfAction::setTemplate() to allow using a template from a different module than the current one

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/action/sfAction.class.php

    r5493 r5813  
    409409   * @param string Template name 
    410410   */ 
    411   public function setTemplate($name
     411  public function setTemplate($name, $module = null
    412412  { 
    413413    if (sfConfig::get('sf_logging_enabled')) 
    414414    { 
    415       $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Change template to "%s"', $name)))); 
     415      $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Change template to "%s/%s"', is_null($module) ? 'CURRENT' : $module, $name)))); 
     416    } 
     417 
     418    if (!is_null($module)) 
     419    { 
     420      $name = sfConfig::get('sf_app_dir').'/modules/'.$module.'/templates/'.$name; 
    416421    } 
    417422