Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <?php
  2. namespace Famelo\Soup\ViewHelpers;
  3.  
  4. /*
  5. * This file belongs to the package "TYPO3 Fluid".
  6. * See LICENSE.txt that was shipped with this package.
  7. */
  8.  
  9. use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
  10.  
  11. /**
  12. *
  13. * @api
  14. */
  15. class BlockViewHelper extends AbstractViewHelper {
  16.  
  17. /**
  18. * @var boolean
  19. */
  20. protected $escapeOutput = FALSE;
  21.  
  22. /**
  23. * @return void
  24. */
  25. public function initializeArguments() {
  26. parent::initializeArguments();
  27. $this->registerArgument('partial', 'string', 'Partial to render, with or without section');
  28. $this->registerArgument('arguments', 'array', 'Array of variables to be transferred. Use {_all} for all variables', FALSE, array());
  29. }
  30.  
  31. /**
  32. * Renders the content.
  33. *
  34. * @return string
  35. * @api
  36. */
  37. public function render() {
  38. $partial = $this->arguments['partial'];
  39. $arguments = (array) $this->arguments['arguments'];
  40. $arguments['content'] = $this->renderChildren();
  41. return $this->viewHelperVariableContainer->getView()->renderPartial($partial, NULL, $arguments);
  42. }
  43.  
  44. /**
  45. * @param array $arguments
  46. * @return void
  47. */
  48. public function handleAdditionalArguments(array $arguments) {
  49. $this->arguments['arguments'] = array_replace(
  50. $this->arguments['arguments'],
  51. $arguments
  52. );
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement