WebLauncher / php-framework

WebLauncher Framework
0 stars 0 forks source link

Views: Add layout manager #7

Open mihaivarga opened 9 years ago

mihaivarga commented 9 years ago

Add ability for users to create their own master layout .

By default system should require no layout.

It will still use default system included layout.

Layouts location: /{module}/views/{skin}/layouts/

Layout file name: {layout}.tpl

Layout structure:

It should contain the main html structure:

`

{$page_after_start_head|default:''} {$system_metas} {$system_title} {$system_styles} {$system_scripts} {$page_before_close_head|default:''} {$page_after_start_body|default:''} {$system_noscript} {$content} {$page_before_close_body}

{$page_after_body} `

Including content templates is done by using {$content} variable.

Including system set scripts (js files) is done by using {$system_scripts} variable.

Including system set stylesheets (css files) is done by using {$system_styles} variable.

Including system metas is done using {$system_metas} variable.

Including system no script functionality is done using {$system_noscript}

Setting a different layout for display:

$this->system->setLayout('newlayout');

This will look for the layout file /modules/{module}/views/{skin}/layouts/newlayout.tpl and will render it.

There is no controller for the layout as it is only a templateing feature.