Changeset 4937
- Timestamp:
- 08/30/07 10:40:10 (2 years ago)
- Files:
-
- trunk/UPGRADE (modified) (1 diff)
- trunk/lib/action/sfComponent.class.php (modified) (1 diff)
- trunk/lib/controller/sfController.class.php (modified) (1 diff)
- trunk/lib/task/project/upgrade1.1/sfComponentUpgrade.class.php (added)
- trunk/test/functional/fixtures/project/apps/frontend/modules/presentation/actions/actions.class.php (modified) (1 diff)
- trunk/test/functional/fixtures/project/apps/frontend/modules/presentation/templates/indexSuccess.php (modified) (1 diff)
- trunk/test/functional/genericTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/UPGRADE
r4936 r4937 41 41 42 42 The `project:upgrade1.1` task makes all those changes for you. 43 44 Deprecated methods in sfComponent 45 --------------------------------- 46 47 The following methods of `sfComponent` have been removed: 48 49 * `->getPresentationFor()` 50 * `->sendEmail()` 51 52 They are accessible from `sfController`: 53 54 [php] 55 // action 56 $this->getController()->getPresentationFor(...); 57 58 The `project:upgrade1.1` task makes all those changes for you. trunk/lib/action/sfComponent.class.php
r4934 r4937 318 318 319 319 /** 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 for325 *326 * <code>$this->getController()->sendEmail($module, $action)</code>327 *328 * @param string A module name329 * @param string An action name330 *331 * @return string The generated mail content332 *333 * @see sfMailView, getPresentationFor(), sfController334 */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 for344 *345 * <code>$this->getController()->getPresentationFor($module, $action, $viewName)</code>346 *347 * @param string A module name348 * @param string An action name349 * @param string A View class name350 *351 * @return string The generated content352 *353 * @see sfController354 */355 public function getPresentationFor($module, $action, $viewName = null)356 {357 return $this->getController()->getPresentationFor($module, $action, $viewName);358 }359 360 /**361 320 * Calls methods defined via the sfMixer class. 362 321 * trunk/lib/controller/sfController.class.php
r4664 r4937 441 441 442 442 /** 443 * Sends and email from the current action.443 * Sends and email. 444 444 * 445 445 * 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 13 13 public function executeIndex() 14 14 { 15 $this->foo1 = $this->getPresentationFor('presentation', 'foo'); 16 $this->foo2 = $this->getController()->getPresentationFor('presentation', 'foo'); 15 $this->foo = $this->getController()->getPresentationFor('presentation', 'foo'); 17 16 } 18 17 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 168 168 get('/presentation')-> 169 169 isStatusCode(200)-> 170 checkResponseElement('#foo1', 'foo')-> 171 checkResponseElement('#foo2', 'foo')-> 172 checkResponseElement('#foo3', 'foo') 170 checkResponseElement('#foo', 'foo')-> 171 checkResponseElement('#foo_bis', 'foo') 173 172 ;

