https://github.com/talesoft/tale-jade-smvc
Tale Jade Implementation into the PHP Simple MVC Framework
https://github.com/talesoft/tale-jade-smvc
Last synced: 11 months ago
JSON representation
Tale Jade Implementation into the PHP Simple MVC Framework
- Host: GitHub
- URL: https://github.com/talesoft/tale-jade-smvc
- Owner: Talesoft
- License: mit
- Created: 2015-10-10T13:30:51.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-13T02:15:40.000Z (almost 11 years ago)
- Last Synced: 2025-08-10T23:51:48.958Z (12 months ago)
- Language: PHP
- Size: 250 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tale-jade-smvc
Tale Jade Implementation into the PHP Simple MVC Framework
# Short introduction
Simply add following into the `Core\Controller` Class:
$this->renderer = new \Tale\Jade\Renderer([
'paths' => [__DIR__.'/../views']
]);
Also don't forget to *Add following as property:* `public $renderer;`
That's it! Now instead using the `View::render[Template]` Methods, you can use:
echo $this->renderer->render('filename', ['data' => $data]);
The final Class should look like this:
abstract class Controller
{
/**
* view variable to use the view class
* @var string
*/
public $view;
public $language;
public $renderer;
/**
* on run make an instance of the config class and view class
*/
public function __construct()
{
//initialise the views object
$this->view = new View();
//initialise the language object
$this->language = new Language();
$this->renderer = new \Tale\Jade\Renderer([
'paths' => [__DIR__.'/../views']
]);
}
}
Because we didn't removed the `$view View` you still can use the `View::render[Template]` Methods if you want.
# Further Questions?
For further questions don't hesitate to ask us!
Cagatay Ulubay
Torben Köhn
URL: http://jade.talesoft.io