sfWebResponse::merge PHP Method

merge() public method

Merges all properties from a given sfWebResponse object to the current one.
public merge ( sfWebResponse $response )
$response sfWebResponse An sfWebResponse instance
    public function merge(sfWebResponse $response)
    {
        foreach ($this->getPositions() as $position) {
            $this->javascripts[$position] = array_merge($this->getJavascripts($position), $response->getJavascripts($position));
            $this->stylesheets[$position] = array_merge($this->getStylesheets($position), $response->getStylesheets($position));
        }
        $this->slots = array_merge($this->getSlots(), $response->getSlots());
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Merges all properties from a given opWebResponse object to the current one.
  *
  * @param sfWebResponse $response  An sfWebResponse instance
  *
  * @see sfWebResponse->merge()
  */
 public function merge(sfWebResponse $response)
 {
     parent::merge($response);
     if ($response instanceof opWebResponse) {
         foreach ($this->getPositions() as $position) {
             $this->smtJavascripts[$position] = array_merge($this->getSmtJavascripts($position), $response->getSmtJavascripts($position));
             $this->smtStylesheets[$position] = array_merge($this->getSmtStylesheets($position), $response->getSmtStylesheets($position));
         }
     }
 }