src/FunctionGenerator.php
private function addDefaultFunction()
    {
        $this->addFunction('app', function () {
            return app();
        });

        $this->addFunction('url', function ($url, $absolute = false, array $params = array()) {
            if ($absolute) {
                return Url::createAbsolute($url, $params);
            } else {
                return Url::create($url, $params);
            }
        });

        $this->addFunction('assets', function ($path) {
            return Url::createAbsolute($path);
        });
    }
private function addDefaultFunction()
    {
        $this->addFunction('app', function () {
            return app();
        });

        $this->addFunction('url', function ($url, $absolute = false, array $params = array()) {
            if ($absolute) {
                return Url::createAbsolute($url, $params);
            } else {
                return Url::create($url, $params);
            }
        });

        $this->addFunction('assets', function ($path) {
            return Url::createAbsolute($path);
        });
    }
private function addDefaultFunction ( ) { $ this -> addFunction ( 'app' , function ( ) { return app ( ) ; } ) ; $ this -> addFunction ( 'url' , function ( $ url , $ absolute = false , array $ params = array ( ) ) { if ( $ absolute ) { return Url :: createAbsolute ( $ url , $ params ) ; } else { return Url :: create ( $ url , $ params ) ; } } ) ; $ this -> addFunction ( 'assets' , function ( $ path ) { return Url :: createAbsolute ( $ path ) ; } ) ; }
Adds default function for twig template.
Adds default function for twig template .