aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/View.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-12-05 15:27:56 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-12-05 15:27:56 +0100
commitc6a682deb94111c1e14cf10e565da3f4214f02dc (patch)
tree38bdc2fe627735e0453b8a930ea2b71ad38bb69c /lib/Minz/View.php
parentf8aa66152fcab24ae7cd9663dab0c0c96a45ca24 (diff)
Extensions can define new views
- View base pathname is set to the extension directory - An extension can now override an existing controller / view See https://github.com/FreshRSS/FreshRSS/issues/252
Diffstat (limited to 'lib/Minz/View.php')
-rw-r--r--lib/Minz/View.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Minz/View.php b/lib/Minz/View.php
index b40448491..bdfbbe63c 100644
--- a/lib/Minz/View.php
+++ b/lib/Minz/View.php
@@ -12,6 +12,7 @@ class Minz_View {
const LAYOUT_PATH_NAME = '/layout';
const LAYOUT_FILENAME = '/layout.phtml';
+ private $base_pathname = APP_PATH;
private $view_filename = '';
private $use_layout = null;
@@ -35,12 +36,15 @@ class Minz_View {
* Change le fichier de vue en fonction d'un controller / action
*/
public function change_view($controller_name, $action_name) {
- $this->view_filename = APP_PATH
- . self::VIEWS_PATH_NAME . '/'
+ $this->view_filename = self::VIEWS_PATH_NAME . '/'
. $controller_name . '/'
. $action_name . '.phtml';
}
+ public function setBasePathname($base_pathname) {
+ $this->base_pathname = $base_pathname;
+ }
+
/**
* Construit la vue
*/
@@ -70,7 +74,7 @@ class Minz_View {
* Affiche la Vue en elle-même
*/
public function render () {
- if ((include($this->view_filename)) === false) {
+ if ((include($this->base_pathname . $this->view_filename)) === false) {
Minz_Log::notice('File not found: `' . $this->view_filename . '`');
}
}