dev-master
9999999-devA simple php view renderer.
MIT
The Requires
- php >=7.1
The Development Requires
1.0
1.0.0.0A simple php view renderer.
MIT
The Requires
- php >=7.1
The Development Requires
A simple php view renderer.
A simple php view renderer., (*1)
To install Cocoon via composer, run the following command:, (*2)
composer require james-draper/cocoon
Here is a simple example of how to render a view, for a more detailed explanation consult the documentation., (*3)
<?php $factory = new \Cocoon\Factory([__DIR__ . '/views']) return $factory ->create('path/to/template') ->setVar('some_var', 123) ->setVarRaw('some_other_var', 456) ->render();
The above code snippet first creates a factory, uses the factory to creates a view, assigns variables to that view, and then renders the view. Below is what the template file might contain., (*4)
<p>var1: <?php echo $this->some_var; ?></p> <p>var2: <?php echo $this->some_other_var; ?></p>
A simple php view renderer.
MIT
A simple php view renderer.
MIT