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;
|
||||
}
|
31
vendor/slim/views/SmartyPlugins/function.currentUrl.php
vendored
Executable file
31
vendor/slim/views/SmartyPlugins/function.currentUrl.php
vendored
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: function.currentUrl.php
|
||||
* Type: function
|
||||
* Name: currentUrl
|
||||
* Purpose: outputs url for a function with the defined name method
|
||||
* version 0.1.3
|
||||
* package SlimViews
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_currentUrl($params, $template)
|
||||
{
|
||||
$appName = isset($params['appname']) ? $params['appname'] : 'default';
|
||||
$withQueryString = isset($params['queryString']) ? $params['queryString'] : true;
|
||||
|
||||
$app = \Slim\Slim::getInstance($appName);
|
||||
$req = $app->request();
|
||||
$uri = $req->getUrl() . $req->getPath();
|
||||
|
||||
if ($withQueryString) {
|
||||
$env = $app->environment();
|
||||
|
||||
if ($env['QUERY_STRING']) {
|
||||
$uri .= '?' . $env['QUERY_STRING'];
|
||||
}
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
27
vendor/slim/views/SmartyPlugins/function.siteUrl.php
vendored
Executable file
27
vendor/slim/views/SmartyPlugins/function.siteUrl.php
vendored
Executable file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: function.siteUrl.php
|
||||
* Type: function
|
||||
* Name: siteUrl
|
||||
* Purpose: outputs url for a function with the defined name method
|
||||
* version 0.1.3
|
||||
* package SlimViews
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_siteUrl($params, $template)
|
||||
{
|
||||
$withUri = isset($params['withUri']) ? $params['withUri'] : true;
|
||||
$appName = isset($params['appname']) ? $params['appname'] : 'default';
|
||||
$url = isset($params['url']) ? $params['url'] : '';
|
||||
|
||||
$req = \Slim\Slim::getInstance($appName)->request();
|
||||
$uri = $req->getUrl();
|
||||
|
||||
if ($withUri) {
|
||||
$uri .= $req->getRootUri();
|
||||
}
|
||||
|
||||
return $uri . '/' . ltrim($url, '/');
|
||||
}
|
42
vendor/slim/views/SmartyPlugins/function.urlFor.php
vendored
Executable file
42
vendor/slim/views/SmartyPlugins/function.urlFor.php
vendored
Executable file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: function.urlFor.php
|
||||
* Type: function
|
||||
* Name: urlFor
|
||||
* Purpose: outputs url for a function with the defined name method
|
||||
* @version 0.1.3
|
||||
* @package SlimViews
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_urlFor($params, $template)
|
||||
{
|
||||
$name = isset($params['name']) ? $params['name'] : '';
|
||||
$appName = isset($params['appname']) ? $params['appname'] : 'default';
|
||||
|
||||
$url = \Slim\Slim::getInstance($appName)->urlFor($name);
|
||||
|
||||
if (isset($params['options'])) {
|
||||
switch (gettype($params['options'])) {
|
||||
case 'array':
|
||||
$opts = $params['options'];
|
||||
break;
|
||||
|
||||
case 'string':
|
||||
$options = explode('|', $params['options']);
|
||||
foreach ($options as $option) {
|
||||
list($key, $value) = explode('.', $option);
|
||||
$opts[$key] = $value;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception('Options parameter is of unknown type, provide either string or array');
|
||||
}
|
||||
|
||||
$url = \Slim\Slim::getInstance($appName)->urlFor($name, $opts);
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
Reference in New Issue
Block a user