Skip to content

Commit

Permalink
version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobg committed Dec 12, 2019
1 parent 8df9f3b commit 126030f
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 21 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,9 @@ gradle-app.setting

##### Composer
composer.phar
composer.dev.json
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock

##### PHP CodeSniffer
# gitignore for the PHP Codesniffer framework
# website: https://github.com/squizlabs/PHP_CodeSniffer
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

A simple pure PHP app showing how to use [Formularium](https://github.com/Corollarium/Formularium).

## How to run

- clone repo locally
- run `composer install`
- run `php -S localhost:8080`
- open http://localhost:8080 in your browser

## About

This is a minimum simple example of how to use Formularium, using plain PHP without any PHP frameworks. It uses [Bootstrap](https://getbootstrap.com/) for styling.
This is a minimum simple example of how to use Formularium, using plain PHP without any PHP frameworks. It uses [Bootstrap](https://getbootstrap.com/) for styling. It only uses the browser validation. We do not validate the `aaaaa` field with a pattern on purpose so you can submit and see the backend validation too.

- [index.php](https://github.com/Corollarium/Formularium-example/blob/master/index.php): Renders a form. This is your C in CRUD.
- [index.php](https://github.com/Corollarium/Formularium-example/blob/master/index.php): Renders a form.
- [model.php](https://github.com/Corollarium/Formularium-example/blob/master/model.php): The object model, with all its fields.
- [post.php](https://github.com/Corollarium/Formularium-example/blob/master/post.php): The post form action. Only validates and renders the output.
- [Datatype_aaaaa.php](https://github.com/Corollarium/Formularium-example/blob/master/Datatype_aaaaa.php): A custom datatype. In this case it is a field that requires you to
Expand Down
13 changes: 2 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,8 @@
"homepage": "https://github.com/Corollarium/FormulariumApp",
"require": {
"php": ">=7.1.0",
"corollarium/formularium": "@dev"
"corollarium/formularium": "^0.1.0"
},
"repositories": [
{
"type": "path",
"url": "../formularium/",
"options": {
"symlink": true
}
}
],
"scripts": {
}
}
}
252 changes: 252 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
?>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<footer>
<a href="https://github.com/Corollarium/Formularium">Formularium on GitHub</a>
<footer style="text-align: center; margin-top: 2em;">
<small>
See <a href="https://github.com/Corollarium/Formularium">Formularium on GitHub</a>
</small>
<?php echo FrameworkComposer::htmlFooter(); ?>
</footer>
</div>
Expand Down
6 changes: 4 additions & 2 deletions post.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
?>
</div>

<footer>
<a href="https://github.com/Corollarium/Formularium">Formularium on GitHub</a>
<footer style="text-align: center; margin-top: 2em;">
<small>
See <a href="https://github.com/Corollarium/Formularium">Formularium on GitHub</a>
</small>
<?php echo FrameworkComposer::htmlFooter(); ?>
</footer>
</div>
Expand Down

0 comments on commit 126030f

Please sign in to comment.