Development

Changeset 4937

You must first sign up to be able to contribute.

Changeset 4937

Show
Ignore:
Timestamp:
08/30/07 10:40:10 (2 years ago)
Author:
fabien
Message:

removed getPresentationFor() and sendEmail() from sfComponent as they are available through the sfController class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/UPGRADE

    r4936 r4937  
    4141 
    4242The `project:upgrade1.1` task makes all those changes for you. 
     43 
     44Deprecated methods in sfComponent 
     45--------------------------------- 
     46 
     47The following methods of `sfComponent` have been removed: 
     48 
     49  * `->getPresentationFor()` 
     50  * `->sendEmail()` 
     51 
     52They are accessible from `sfController`: 
     53 
     54  [php] 
     55  // action 
     56  $this->getController()->getPresentationFor(...); 
     57 
     58The `project:upgrade1.1` task makes all those changes for you. 
  • trunk/lib/action/sfComponent.class.php

    r4934 r4937  
    318318 
    319319  /** 
    320    * Sends and email from the current action. 
    321    * 
    322    * This methods calls a module/action with the sfMailView class. 
    323    * 
    324    * This is a shortcut for 
    325    * 
    326    * <code>$this->getController()->sendEmail($module, $action)</code> 
    327    * 
    328    * @param  string A module name 
    329    * @param  string An action name 
    330    * 
    331    * @return string The generated mail content 
    332    * 
    333    * @see sfMailView, getPresentationFor(), sfController 
    334    */ 
    335   public function sendEmail($module, $action) 
    336   { 
    337     return $this->getController()->getPresentationFor($module, $action, 'sfMail'); 
    338   } 
    339  
    340   /** 
    341    * Returns the rendered view presentation of a given module/action. 
    342    * 
    343    * This is a shortcut for 
    344    * 
    345    * <code>$this->getController()->getPresentationFor($module, $action, $viewName)</code> 
    346    * 
    347    * @param  string A module name 
    348    * @param  string An action name 
    349    * @param  string A View class name 
    350    * 
    351    * @return string The generated content 
    352    * 
    353    * @see sfController 
    354    */ 
    355   public function getPresentationFor($module, $action, $viewName = null) 
    356   { 
    357     return $this->getController()->getPresentationFor($module, $action, $viewName); 
    358   } 
    359  
    360   /** 
    361320   * Calls methods defined via the sfMixer class. 
    362321   * 
  • trunk/lib/controller/sfController.class.php

    r4664 r4937  
    441441 
    442442  /** 
    443    * Sends and email from the current action
     443   * Sends and email
    444444   * 
    445445   * This methods calls a module/action with the sfMailView class. 
  • trunk/test/functional/fixtures/project/apps/frontend/modules/presentation/actions/actions.class.php

    r3209 r4937  
    1313  public function executeIndex() 
    1414  { 
    15     $this->foo1 = $this->getPresentationFor('presentation', 'foo'); 
    16     $this->foo2 = $this->getController()->getPresentationFor('presentation', 'foo'); 
     15    $this->foo = $this->getController()->getPresentationFor('presentation', 'foo'); 
    1716  } 
    1817 
  • trunk/test/functional/fixtures/project/apps/frontend/modules/presentation/templates/indexSuccess.php

    r3209 r4937  
    1 <div id="foo1"><?php echo $foo1 ?></div> 
    2 <div id="foo2"><?php echo $foo2 ?></div> 
    3 <div id="foo3"><?php echo $sf_context->getController()->getPresentationFor('presentation', 'foo') ?></div> 
     1<div id="foo"><?php echo $foo ?></div> 
     2<div id="foo_bis"><?php echo $sf_context->getController()->getPresentationFor('presentation', 'foo') ?></div> 
  • trunk/test/functional/genericTest.php

    r4560 r4937  
    168168  get('/presentation')-> 
    169169  isStatusCode(200)-> 
    170   checkResponseElement('#foo1', 'foo')-> 
    171   checkResponseElement('#foo2', 'foo')-> 
    172   checkResponseElement('#foo3', 'foo') 
     170  checkResponseElement('#foo', 'foo')-> 
     171  checkResponseElement('#foo_bis', 'foo') 
    173172; 

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.