Changeset 9477
- Timestamp:
- 06/09/08 11:41:14 (2 years ago)
- Files:
-
- branches/1.1/lib/action/sfAction.class.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/action/sfAction.class.php
r9044 r9477 257 257 258 258 /** 259 * Appends the result of the given partial execution to the response content 260 * and bypasses the built-in view system. 259 * Returns the partial rendered content. 261 260 * 262 261 * If the vars parameter is omitted, the action's internal variables … … 266 265 * available in the partial. 267 266 * 268 * This method must be called as with a return:269 *270 * <code>return $this->renderPartial('foo/bar')</code>271 *272 267 * @param string $templateName partial name 273 268 * @param array $vars vars 274 269 * 270 * @return string The partial content 271 */ 272 public function getPartial($templateName, $vars = null) 273 { 274 sfLoader::loadHelpers('Partial'); 275 276 $vars = !is_null($vars) ? $vars : $this->varHolder->getAll(); 277 278 return get_partial($templateName, $vars); 279 } 280 281 /** 282 * Appends the result of the given partial execution to the response content. 283 * 284 * This method must be called as with a return: 285 * 286 * <code>return $this->renderPartial('foo/bar')</code> 287 * 288 * @param string $templateName partial name 289 * @param array $vars vars 290 * 275 291 * @return sfView::NONE 292 * 293 * @see getPartial 276 294 */ 277 295 public function renderPartial($templateName, $vars = null) 278 296 { 279 sfLoader::loadHelpers('Partial'); 280 281 $vars = !is_null($vars) ? $vars : $this->varHolder->getAll(); 282 283 return $this->renderText(get_partial($templateName, $vars)); 284 } 285 286 /** 287 * Appends the result of the given component execution to the response content 288 * and bypasses the built-in view system. 297 return $this->renderText($this->getPartial($templateName, $vars)); 298 } 299 300 /** 301 * Returns the component rendered content. 289 302 * 290 303 * If the vars parameter is omitted, the action's internal variables … … 293 306 * If the vars parameter is set then only those values are 294 307 * available in the component. 295 *296 * This method must be called as with a return:297 *298 * <code>return $this->renderComponent('foo', 'bar')</code>299 308 * 300 309 * @param string $moduleName module name … … 302 311 * @param array $vars vars 303 312 * 313 * @return string The component rendered content 314 */ 315 public function getComponent($moduleName, $componentName, $vars = null) 316 { 317 sfLoader::loadHelpers('Partial'); 318 319 $vars = !is_null($vars) ? $vars : $this->varHolder->getAll(); 320 321 return get_component($moduleName, $componentName, $vars); 322 } 323 324 /** 325 * Appends the result of the given component execution to the response content. 326 * 327 * This method must be called as with a return: 328 * 329 * <code>return $this->renderComponent('foo', 'bar')</code> 330 * 331 * @param string $moduleName module name 332 * @param string $componentNae component name 333 * @param array $vars vars 334 * 304 335 * @return sfView::NONE 336 * 337 * @see getComponent 305 338 */ 306 339 public function renderComponent($moduleName, $componentName, $vars = null) 307 340 { 308 sfLoader::loadHelpers('Partial'); 309 310 $vars = !is_null($vars) ? $vars : $this->varHolder->getAll(); 311 312 return $this->renderText(get_component($moduleName, $componentName, $vars)); 341 return $this->renderText($this->getComponent($moduleName, $componentName, $vars)); 313 342 } 314 343

