Development

Changeset 8427

You must first sign up to be able to contribute.

Changeset 8427

Show
Ignore:
Timestamp:
04/11/08 23:33:01 (1 year ago)
Author:
dwhittle
Message:

1.1: fixed renderComponent (closes #3317)

Files:

Legend:

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

    r7792 r8427  
    278278    sfLoader::loadHelpers('Partial'); 
    279279 
    280     $vars = $vars ? $vars : $this->varHolder->getAll(); 
     280    $vars = !is_null($vars) ? $vars : $this->varHolder->getAll(); 
    281281 
    282282    return $this->renderText(get_partial($templateName, $vars)); 
    283283  } 
    284  
    285284 
    286285  /** 
     
    288287   * and bypasses the built-in view system. 
    289288   * 
     289   * If the vars parameter is omitted, the action's internal variables 
     290   * will be passed, just as it would to a normal template. 
     291   * 
     292   * If the vars parameter is set then only those values are 
     293   * available in the component. 
     294   * 
    290295   * This method must be called as with a return: 
    291296   * 
     
    294299   * @param  string module name 
    295300   * @param  string component name 
     301   * @param  array vars 
    296302   * 
    297303   * @return sfView::NONE 
    298304   */ 
    299   public function renderComponent($moduleName, $componentName
     305  public function renderComponent($moduleName, $componentName, $vars = null
    300306  { 
    301307    sfLoader::loadHelpers('Partial'); 
    302308 
    303     return $this->renderText(get_component($templateName, $componentName, $this->varHolder->getAll())); 
     309    $vars = !is_null($vars) ? $vars : $this->varHolder->getAll(); 
     310 
     311    return $this->renderText(get_component($moduleName, $componentName, $vars)); 
    304312  } 
    305313 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.