Skip to content

Commit

Permalink
inherit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
igaster committed Feb 27, 2015
1 parent 4f6e137 commit 83600d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ public function url($url){
throw new \Exception("$fullPath - not found");
}

// get theme's configuration
public function config($key){
if (array_key_exists($key, $conf = \Config::get("themes.themes")[$this->name]))
return $conf[$key];

if ($this->getParent())
return $this->getParent()->config($key);

return null;
}


}


Expand Down
2 changes: 1 addition & 1 deletion src/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function get(){

// get current theme's configuration
public function config($key){
return \Config::get("themes.themes")[$this->get()][$key];
return $this->activeTheme->config($key);
}

public function url($url){
Expand Down

0 comments on commit 83600d8

Please sign in to comment.