import v1.0.0-RC4 | 2009-05-20
This commit is contained in:
26
libs/Monkeys/View/Helper/GetBase.php
Executable file
26
libs/Monkeys/View/Helper/GetBase.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Monkeys_View_Helper_GetBase
|
||||
{
|
||||
public function getBase()
|
||||
{
|
||||
$ctrl = Zend_Controller_Front::getInstance();
|
||||
$baseUrl = $ctrl->getBaseUrl();
|
||||
$url = rtrim($baseUrl, '/');
|
||||
|
||||
if (substr($baseUrl, strlen($baseUrl) - 9) == 'index.php') {
|
||||
$url = substr($baseUrl, 0, strlen($baseUrl) - 10);
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user