-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add base controller class & update tests.
For the more complex controllers like the run controllers using mocks is not going to be easy/fun. Add some more 'framework' to make testing easier.
- Loading branch information
Showing
4 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
class Xhgui_Controller | ||
{ | ||
protected $_templateVars = array(); | ||
protected $_template = null; | ||
|
||
public function set($vars) | ||
{ | ||
$this->_templateVars = array_merge($this->_templateVars, $vars); | ||
} | ||
|
||
public function templateVars() | ||
{ | ||
return $this->_templateVars; | ||
} | ||
|
||
public function render() | ||
{ | ||
$this->_app->render($this->_template, $this->_templateVars); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters