ControllerReference.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel\Controller;
  11. /**
  12. * Acts as a marker and a data holder for a Controller.
  13. *
  14. * Some methods in Symfony accept both a URI (as a string) or a controller as
  15. * an argument. In the latter case, instead of passing an array representing
  16. * the controller, you can use an instance of this class.
  17. *
  18. * @author Fabien Potencier <fabien@symfony.com>
  19. *
  20. * @see Symfony\Component\HttpKernel\FragmentRenderer
  21. * @see Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface
  22. */
  23. class ControllerReference
  24. {
  25. public $controller;
  26. public $attributes = array();
  27. public $query = array();
  28. /**
  29. * Constructor.
  30. *
  31. * @param string $controller The controller name
  32. * @param array $attributes An array of parameters to add to the Request attributes
  33. * @param array $query An array of parameters to add to the Request query string
  34. */
  35. public function __construct($controller, array $attributes = array(), array $query = array())
  36. {
  37. $this->controller = $controller;
  38. $this->attributes = $attributes;
  39. $this->query = $query;
  40. }
  41. }