Universeorange.com/Docs/
Edit view in:
/project_dir/Host/
<subdomain>
/<hostname>
/<extension>
/Docs/View/Get.tpl
With content:
{$menu = menu.get(request('page'))}
<ul class="menu">
{if(!is.empty($menu) && is.array($menu))}
{for.each($menu as $nr => $item)}
/**
* Where menu.item.html() returns
* <a href="{$item.href}" class="{$item.class}"><li>{$item.title}</li></a>
*/
{menu.item.html($item)}
{/for.each}
{/if}
</ul>
/**
* Where page.get() returns
* Hello world, this is page {request('page')}
*/
{$page = page.get(request('page'))}
{$page}
$menu
as array []
.menu.get()
.if()
.is.empty()
.is.array()
.for.each()
.menu.item.html()
.for.each
plugin.if
plugin.$page
as string
;page.get()
.$page
.We could write it even easier:
/**
* Where menu.get() shows
* <ul class="menu">
* <a href="{/page/Welcome/" class="page-welcome"><li>...</li></a>
* ...
* </ul>
*/
{menu.get(request('page'))}
/**
* Where page.get() shows
* Hello world, this is page Welcome
*/
{page.get(request('page'))}
menu.get()
.page.get()
.Next: add a custom plugin
Last modified: 2021-06-07
© 2021 universeorange.com