PHP code example of samsoncms / template
1. Go to this page and download the library: Download samsoncms/template library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
samsoncms / template example snippets
function oldMenuRenderer(&$html, &$subMenu)
{
// Iterate loaded samson\cms\application
foreach (\samson\cms\App::loaded() as $app) {
// Show only visible apps
if ($app->hide == false) {
// Render application menu item
$html .= m('template')
->view('menu/item')
->active(url()->module == $app->id() ? 'active' : '')
->app($app)
->icon($app->icon)
->name(isset($app->name{0}) ? $app->name : (isset($app->app_name{0}) ? $app->app_name : ''))
->output();
}
}
$subMenu = '';
// Find current SamsonCMS application
if (\samson\cms\App::find(url()->module, $app/*@var $app App*/)) {
// Render main-menu application sub-menu
$subMenu = $app->submenu();
// If module has sub_menu view - render it
if ($app->findView('sub_menu')) {
$subMenu .= $app->view('sub_menu')->output();
}
}
}
<i>