1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00

add current url controller

This commit is contained in:
stephenbe
2015-04-21 16:29:58 -04:00
parent f2c2ab37e7
commit 592af9db0d

View File

@@ -86,7 +86,7 @@ class Boilerplate_Template_Controller extends Charcoal_Template_Controller
* Read the documentation on `\Charcoal\Object_Loader` for more details.
* In short, it allows to call the objects with `->texts()->ident;` // `{{sections.ident}}` to return (and load on-the-fly, if required)
* the `CMS_Text` object with the `ident` "ident".
*
*
* @return \Charcoal\Object_Loader
* @see CMS_Section
*/
@@ -109,7 +109,7 @@ class Boilerplate_Template_Controller extends Charcoal_Template_Controller
* Read the documentation on `\Charcoal\Object_Loader` for more details.
* In short, it allows to call the objects with `->sections()->ident;` to return (and load on-the-fly, if required)
* the `CMS_Section` object with the `ident` "ident".
*
*
* @return \Charcoal\Object_Loader
* @see CMS_Text
*/
@@ -144,6 +144,16 @@ class Boilerplate_Template_Controller extends Charcoal_Template_Controller
return \Charcoal::$config['URL'];
}
/**
* Return the current URL *
*
* @return string
*/
public function current_url()
{
return Charcoal::$config['HTTP_MODE'] . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
/**
* Test templating.
*
@@ -187,7 +197,7 @@ class Boilerplate_Template_Controller extends Charcoal_Template_Controller
* @see \Charcoal\Asset
*/
public function assets($asset_mode='url')
{
{
$ret = [
'images' => function($txt) use ($asset_mode) {
return new \Charcoal\Asset('images', $txt, $asset_mode);