Added vendor/ directory for Composer's installed files

This commit is contained in:
Ascendings
2015-08-30 12:33:20 -04:00
parent 45df179c49
commit b66a773ed8
1162 changed files with 112457 additions and 0 deletions

View 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;
}

View 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;
}

View 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, '/');
}

View 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;
}