code: 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);
          });
      }
docs: Adds default function for twig template.