Added vendor/ directory for Composer's installed files
This commit is contained in:
26
vendor/slim/views/SmartyPlugins/function.baseUrl.php
vendored
Executable file
26
vendor/slim/views/SmartyPlugins/function.baseUrl.php
vendored
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: function.baseUrl.php
|
||||
* Type: function
|
||||
* Name: baseUrl
|
||||
* Purpose: outputs url for a function with the defined name method
|
||||
* version 0.1.3
|
||||
* package SlimViews
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_baseUrl($params, $template)
|
||||
{
|
||||
$withUri = isset($params['withUri']) ? $params['withUri'] : true;
|
||||
$appName = isset($params['appname']) ? $params['appname'] : 'default';
|
||||
|
||||
$req = \Slim\Slim::getInstance($appName)->request();
|
||||
$uri = $req->getUrl();
|
||||
|
||||
if ($withUri) {
|
||||
$uri .= $req->getRootUri();
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
Reference in New Issue
Block a user