2017 © Pedro Peláez
 

library ql-plugin-simpleform

QueryList Plugin - SimpleForm

image

liesauer/ql-plugin-simpleform

QueryList Plugin - SimpleForm

  • Tuesday, October 3, 2017
  • by liesauer
  • Repository
  • 1 Watchers
  • 0 Stars
  • 76 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 15 % Grown

The README.md

QueryList V4 Plugin - SimpleForm

make form submission easier, (*1)

Installation

composer require liesauer/ql-plugin-simpleform

Bind

  • QueryList simpleForm ($formUrl, $formSelector = '', $formParams = [], $postParams = [], ...$args)
    • formUrl where to get the form
    • formSelector only required if there are two or more form elements
    • formParams use for get the form, read QueryList::get or QueryList::post, default method is get
    • postParams same as formParams but use for form submission, default method is post
    • args no used

Usage

use liesauer\QLPlugin\SimpleForm;
use QL\QueryList;

require_once __DIR__ . '/vendor/autoload.php';

// cookie needed for this example
$cookie = new \GuzzleHttp\Cookie\CookieJar();

$ql = QueryList::getInstance();

// use this plugin
$ql->use(SimpleForm::class);

$username = $ql->simpleForm('https://github.com/login', '', [
    'options' => [
        'verify'  => false,
        'cookies' => $cookie,
    ],
], [
    'params'  => [
        'login'    => 'username',
        'password' => 'password',
    ],
    'options' => [
        'verify'  => false,
        'cookies' => $cookie,
    ],
])->find('.header-nav-current-user>.css-truncate-target')->text();

if (!empty($username)) {
    echo "welcome back, {$username}!\n";
} else {
    $error = $ql->find('.flash-error>.container')->text();
    echo "{$error}\n";
}

The Versions

03/10 2017

dev-master

9999999-dev

QueryList Plugin - SimpleForm

  Sources   Download

MIT

The Requires

 

03/10 2017

v4.0.1

4.0.1.0

QueryList Plugin - SimpleForm

  Sources   Download

MIT

The Requires

 

28/09 2017

v4.0.0

4.0.0.0

QueryList Plugin - SimpleForm

  Sources   Download

MIT

The Requires