CORE/core/view.php : 237 CORE/core/view.php : 196 CORE/core/controller.php : 120 APP/controller/tools/source.php : 75 CORE/core/controller.php : 89 CORE/core/controller.php : 70 CORE/core.php : 170 BASE/index.php : 9 0.00151 - Loading view "view/page/source.html" CORE/core/view.php : 237 CORE/core/view.php : 196 CORE/core/controller.php : 120 APP/controller/index.php : 65 APP/controller/tools/source.php : 75 CORE/core/controller.php : 89 CORE/core/controller.php : 70 CORE/core.php : 170 BASE/index.php : 9 0.00184 - Loading view "view/page.html" UltraLight Showcase

Source for controller:index

<?php namespace App\Controller;
/**
 * This is an anti-pattern, but for the demo we allow it.
 */
\Core::$debug = (\Request::value('debug') || \Config::system()->get('system''debug'false));
/**
 * Simple index page, with some buttons for show.
 */
class Index extends \Core\Controller
{
    
/**
     * All menu buttons for this controller.
     * @var array
     */
    
protected $_buttons = [
        
'Home' => '/',
        
'Examples' => [
            
'Form Example' => '/form',
            
'Color Example' => '/color',
            
'AJAX example' => '/ajax',
            
'Error example' => '/errors',
            
'Wrong page' => '/wrong',
            
'Not found' => '/not_found',
        ],
        
'View source' => 'source/controller/$url',
        
'Debug' => '/$url?debug=true'
    
];

    protected function 
_run()
    {
        
// If there is any remaining part of the url, we show an error page, as expected.
        
if (\Core::$rest) {
            return 
$this->_showError(\Request::STATUS_ERROR_NOT_FOUND'error');
        }
        
\Core\View::registerTransformer('custom''\App\Library\Transform\Custom');
        return 
$this->_output(
            
'Features',
            
$this->_show(
                
'page/features',
                [
'transform' => 'example|transform|text''value' => rand(-20000002000000)],
                
true
            
)
        );
    }

    
/**
     * Create page output.
     * @param string $title
     * @param string $content
     * @return string
     */
    
protected function _output($title$content)
    {
        
$buttons $this->_getButtons($this->_buttons);
        return 
$this->_show('page',
            [
                
'title' => 'UltraLight Showcase',
                
'page' => $title,
                
'menu' => new \Core\Bootstrap\Navbar(
                    
'UltraLight',
                    
$buttons,
                    
\Core::$url,
                    
'navbar-inverse navbar-fixed-top'
                
),
                
'content' => $content
            
]
        );
    }

    
/**
     * This would normally not be needed, but we have dynamic buttons for the current page.
     *
     * This replaces all instances of $url with the current url. Used for the Debug and Source buttons.
     *
     * @return array
     */
    
private function _getButtons($buttons)
    {
        
$result = [];
        
$url \Core::$url;
        foreach (
$buttons as $key => $value) {
            
$result[$key] = !is_array($value) ? str_replace('$url'$url$value) : $this->_getButtons($value);
        }
        return 
$result;
    }
}
CORE/core.php : 185 BASE/index.php : 9 0.00247 - Loaded classes array (14) ( 'Show' => array (2) ( 'file' => "CORE/show.php", 'time' => 0.00023, ), 'Config' => array (2) ( 'file' => "CORE/config.php", 'time' => 0.00026, ), 'Core\Cache' => array (2) ( 'file' => "CORE/core/cache.php", 'time' => 0.00031, ), 'Core\Cache\File' => array (2) ( 'file' => "CORE/core/cache/file.php", 'time' => 0.00031, ), 'Core\Arrays' => array (2) ( 'file' => "CORE/core/arrays.php", 'time' => 0.00051, ), 'Request' => array (2) ( 'file' => "CORE/request.php", 'time' => 0.00092, ), 'Sanitize' => array (2) ( 'file' => "CORE/sanitize.php", 'time' => 0.00095, ), 'Core\Controller' => array (2) ( 'file' => "CORE/core/controller.php", 'time' => 0.00102, ), 'App\Controller\Index' => array (2) ( 'file' => "APP/controller/index.php", 'time' => 0.00103, ), '\App\Controller\Tools\Source' => array (2) ( 'file' => "APP/controller/tools/source.php", 'time' => 0.00103, ), 'Core\View' => array (2) ( 'file' => "CORE/core/view.php", 'time' => 0.00107, ), 'App\Library\Sourcelist' => array (2) ( 'file' => "APP/library/sourcelist.php", 'time' => 0.00143, ), 'Core\Format\Variable' => array (2) ( 'file' => "CORE/core/format/variable.php", 'time' => 0.00163, ), 'Core\Bootstrap\Navbar' => array (2) ( 'file' => "CORE/core/bootstrap/navbar.php", 'time' => 0.00179, ), ) CORE/core.php : 186 BASE/index.php : 9 0.00449 - Debug "Done."