Download the PHP package ingwiephoenix/bird3-flipflop without Composer
On this page you can find all versions of the php package ingwiephoenix/bird3-flipflop. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ingwiephoenix/bird3-flipflop
More information about ingwiephoenix/bird3-flipflop
Files in ingwiephoenix/bird3-flipflop
Package bird3-flipflop
Short Description Super small view engine for those that want to play it safe.
License MIT
Informations about the package bird3-flipflop
FlipFlop - A tiny view engine.
This is FlipFlop. A super, super tiny view engine that is used by BIRD3 to display things in it's new Laravel core.
I made this since I just wanted to run regular PHP templates without anything super fancy. So I just made this!
Features at a glance
- A view is rendered into a layout by default.
- Partial views via
__partial__
variable, or by using the FlipFlop facade. - Views have contexts, so they can use
$this
. - It just overrides your current
PhpEngine
, meaning that we are 100% API compatible.
Install
Your typical
composer require ingwiephoenix/bird3-flipflop
will work just fine.
Next, you'll want to pop config/app.php
and look for
Illuminate\View\ViewServiceProvider::class,
... and add this underneath:
BIRD3\Extensions\FlipFlop\Providers\FlipFlopServiceProfider::class,
... and within the alias
section, you'd add:
"FlipFlop" => BIRD3\Extensions\FlipFlop\Facades\FlipFlop::class,
.. and it's done!
Usage
Layouts
You usually want to define your layout just like any other template. Say you put it into app/Resources/Views/Layouts/main.php
, then you would be able to go right ahead, since this is the default that FlipFlop will look for. To change that:
FlipFlop::setDefaultLayout($viewName)
Just like views, layouts are resolved the same way.
You get the content of the view via the $contents
variable - but you are free to use the features provided by the View
facade as well. If you didn't know, check out what it can actually do.