Skip to content

Commit ed51bf8

Browse files
committed
fixing variables problem
1 parent 5ee193f commit ed51bf8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/core/App.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public function __construct(){
2222

2323
//setting the langauge to default language if not specified.
2424

25-
if(file_exists('../app/languages/' . $req[0])){
25+
if($req != NULL && file_exists('../app/languages/' . $req[0])){
2626
define('LANGUAGE', array_shift($req));
2727
}else{
28-
define('LANGUAGE', $language);
28+
define('LANGUAGE', $this->language);
2929
}
3030

3131
if(file_exists('../app/controllers/' . $req[0] . '.php')){

app/core/Controller.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public function view($view, $data = []){
4444
*/
4545
if(!isset($data['lang']['main'])){
4646
require_once("../app/languages/" . LANGUAGE . "/main.php");
47-
$data['lang']['main'] = $lang;
47+
$data['lang']['main'] = LANGUAGE;
4848
}
4949

5050
$data['view'] = $view;
5151
if(!isset($data['lang'][$view])){
5252
require_once("../app/languages/" . LANGUAGE . "/". $view .".php");
53-
$data['lang'][$view] = $lang;
53+
$data['lang'][$view] = LANGUAGE;
5454
}
5555

5656
//including the header, the view and the footer

0 commit comments

Comments
 (0)