Ejemplo n.º 1
0
 /**
  * @param  string   $route      route is composed by the bundle, controller and action name separated by a dot
  * @param  array    $query      optional url parameters and query parameters
  * @param  string   $httpMethod http method
  *
  * @return string               url
  */
 public function __invoke($route, array $query = [], $httpMethod = 'POST')
 {
     $url = parent::__invoke($route, $query);
     return 'data-bundle="form" action="' . $url . '" data-http-method="' . $this->getJsMethod($httpMethod) . '" method="' . $httpMethod . '"';
 }
Ejemplo n.º 2
0
 /**
  * @param  string   $route      route is composed by the bundle, controller and action name separated by a dot
  * @param  array    $query      optional url parameters and query parameters
  * @param  string   $httpMethod http method
  *
  * @return string               url
  */
 public function __invoke($route, array $query = [], $httpMethod = 'GET')
 {
     $url = parent::__invoke($route, $query);
     return 'data-bundle="link" href="' . $url . '" data-http-method="' . $this->getJsMethod($httpMethod) . '"';
 }