refactoring lang and url classes.
This commit is contained in:
@@ -11,6 +11,13 @@ class Lang {
|
|||||||
*/
|
*/
|
||||||
protected static $lines = array();
|
protected static $lines = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The paths containing the language files.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected static $paths = array(LANG_PATH);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The key of the language line being retrieved.
|
* The key of the language line being retrieved.
|
||||||
*
|
*
|
||||||
@@ -32,13 +39,6 @@ class Lang {
|
|||||||
*/
|
*/
|
||||||
protected $language;
|
protected $language;
|
||||||
|
|
||||||
/**
|
|
||||||
* The paths containing the language files.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $paths = array(LANG_PATH);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Lang instance.
|
* Create a new Lang instance.
|
||||||
*
|
*
|
||||||
@@ -164,7 +164,7 @@ class Lang {
|
|||||||
|
|
||||||
$language = array();
|
$language = array();
|
||||||
|
|
||||||
foreach ($this->paths as $directory)
|
foreach (static::$paths as $directory)
|
||||||
{
|
{
|
||||||
if (file_exists($path = $directory.$this->language.'/'.$file.EXT))
|
if (file_exists($path = $directory.$this->language.'/'.$file.EXT))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class URL {
|
|||||||
{
|
{
|
||||||
if (is_null($https)) $https = Request::secure();
|
if (is_null($https)) $https = Request::secure();
|
||||||
|
|
||||||
return str_replace('index.php/', '', static::to($url, $https));
|
return str_replace(Config::$items['application']['index'].'/', '', static::to($url, $https));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user