All Projects → DODMax → blade_standalone_example

DODMax / blade_standalone_example

Licence: other
No description, website, or topics provided.

Programming Languages

PHP
23972 projects - #3 most used programming language
ApacheConf
554 projects

Windwalker Blade Example

A really simple working example of standalone blade templating using the Windwalker Renderer

Install dependencies via Composer

composer update

Configuration

In config.php

Enter base url for proper URL generation:

const BASE_URL = 'http://localhost';

In helpers.php

Implement any helper your template might use:

function asset($path)
{
	return BASE_URL . '/assets'. $path;
}

Usage

  • Put your blade files in the views/ folder.
<h1>Welcome!</h1>
<p>
	<a href="{{ url('example') }}">Example</a>
</p> 
  • Create a 'controller' for each page in the pages/ folder
class Page
{
	function show($renderer)
	{
		//Render the views/welcome.blade.php file
		return $renderer->render('welcome', []);
	}
}
  • Access your pages by controller file name
http://localhost			=> pages/index.php
http://localhost/example	=> pages/example.php
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].