Example #1
0
    /**
     * Constructor.
     *
     * @param \DOMElement $node       A \DOMElement instance
     * @param string      $currentUri The URI of the page where the form is embedded
     * @param string      $method     The method to use for the link (if null, it defaults to the method defined by the form)
     * @param string      $baseHref   The URI of the <base> used for relative links, but not for empty action
     *
     * @throws \LogicException if the node is not a button inside a form tag
     */
    public function __construct(\DOMElement $node, $currentUri, $method = null, $baseHref = null)
    {
        parent::__construct($node, $currentUri, $method);
        $this->baseHref = $baseHref;

        $this->initialize();
    }
Example #2
0
 /**
  * Constructor.
  *
  * @param \DOMNode $node       A \DOMNode instance
  * @param string   $currentUri The URI of the page where the form is embedded
  * @param string   $method     The method to use for the link (if null, it defaults to the method defined by the form)
  *
  * @throws \LogicException if the node is not a button inside a form tag
  *
  * @api
  */
 public function __construct(\DOMNode $node, $currentUri, $method = null)
 {
     parent::__construct($node, $currentUri, $method);
     $this->initialize();
 }
Example #3
0
 /**
  * @param Crawler $node
  * @param string $currentUri
  */
 public function __construct(Crawler $node, $currentUri)
 {
     parent::__construct($node->getNode(0), $currentUri);
     $this->type = strtolower(trim($node->attr('type')));
 }
Example #4
0
 /**
  * Link constructor.
  *
  * @param DOMElement $node
  * @param string $currentUri
  */
 public function __construct(DOMElement $node, $currentUri)
 {
     parent::__construct($node, $currentUri);
 }