Skip to content

Commit

Permalink
Made edits to readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Robert committed Jan 15, 2022
1 parent 685a980 commit f069db1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ use Chase\Safari\Form;
class LoginForm extends Form
{

public function __construct(){
parent::__construct($_POST);
public function __construct(array $request){

parent::__construct($request);

// These are optional
$this->method = "POST";
Expand Down Expand Up @@ -62,14 +63,14 @@ class LoginForm extends Form
Then, any time you need a login form

```php
$login = new LoginForm;
$login = new LoginForm($_POST);
echo $login->render()
```

Or with different form attributes

```php
$login = new LoginForm;
$login = new LoginForm($_GET);
echo $login->with("method", "GET")->with("action", "/")->with("request", $_GET)->render()
```

Expand All @@ -82,9 +83,10 @@ use Chase\Safari\Form;
class SampleForm extends Form
{

public function __construct()
public function __construct(array $request)
{
parent::__construct($_POST);
parent::__construct($request);

$this->method = "POST";
$this->action = "/login";
$this->target = "_blank";
Expand Down

0 comments on commit f069db1

Please sign in to comment.