-
Notifications
You must be signed in to change notification settings - Fork 205
Getting started
Former is to be used as a View helper – meaning it provides for you a class that you can use directly in your views to output HTML code.
<?= Former::open()->method('GET') ?>
<?= Former::text('name')->required() ?>
<?= Former::close() ?>
If you're using Twig or other more closed view templating systems, you can still use Former's classes outside :
$form = (string)Former::open()->method('GET');
$form .= Former::text('name')->required();
$form .= Former::close();
Modify your composer.json and add: "anahkiasen/former": "4.0.*@dev",
Then run "composer update". Next modify your app/config/app.php
. In the providers
array add :
'Former\FormerServiceProvider',
Add then alias Former's main class by adding its facade to the aliases
array in the same file :
'Former' => 'Former\Facades\Former',
Installing Former is easy as hell. Just type composer require anahkiasen/former
and you're good to go!
Just need to add Former's service provider to your Laravel application in app/config/app.php
. In the providers
array add :
'Former\FormerServiceProvider',
Add then alias Former's main class by adding its facade to the aliases
array in the same file :
'Former' => 'Former\Facades\Former',
Simply do php artisan config:publish anahkiasen/former
Same as for Laravel 4, add Former to your Composer file. Then do this :
use Former\Facades\Former;
And you're done.