Development

Changeset 9313 for branches/1.1/lib

You must first sign up to be able to contribute.

Changeset 9313 for branches/1.1/lib

Show
Ignore:
Timestamp:
05/27/08 12:50:00 (5 years ago)
Author:
fabien
Message:

fixed template.filter_parameters event + added a sf_type variable in all templates to get the template type (action, layout, or partial)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/view/sfPHPView.class.php

    r9151 r9313  
    7070 
    7171    // EXTR_REFS can't be used (see #3595 and #3151) 
    72     extract($this->attributeHolder->toArray()); 
     72    extract($this->dispatcher->filter(new sfEvent($this, 'template.filter_parameters'), $this->attributeHolder->toArray())->getReturnValue()); 
    7373 
    7474    // render 
     
    130130 
    131131    $this->attributeHolder = $this->initializeAttributeHolder(array('sf_content' => new sfOutputEscaperSafe($content))); 
     132    $this->attributeHolder->set('sf_type', 'layout'); 
    132133 
    133134    // render the decorator template and return the result 
     
    165166      $this->preRenderCheck(); 
    166167 
     168      $this->attributeHolder->set('sf_type', 'action'); 
     169 
    167170      // render template file 
    168171      $content = $this->renderFile($this->getDirectory().'/'.$this->getTemplate()); 
  • branches/1.1/lib/view/sfPartialView.class.php

    r9047 r9313  
    8989    $this->preRenderCheck(); 
    9090 
     91    $this->getAttributeHolder()->set('sf_type', 'partial'); 
     92 
    9193    // render template 
    9294    $retval = $this->renderFile($this->getDirectory().'/'.$this->getTemplate()); 
  • branches/1.1/lib/view/sfViewParameterHolder.class.php

    r9047 r9313  
    5454    $this->dispatcher = $dispatcher; 
    5555 
    56     $event = $dispatcher->filter(new sfEvent($this, 'template.filter_parameters'), $parameters); 
    57     $parameters = $event->getReturnValue(); 
    58  
    5956    $this->add($parameters); 
    6057