Skip to content

Commit

Permalink
Adding nested view path option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Hoyt committed Dec 15, 2010
1 parent 33af62b commit 4d8b709
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions controllers/components/wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ class WizardComponent extends Object {
* @access public
*/
var $lockdown = false;
/**
* If true, the component will render views found in views/{wizardAction}/{step}.ctp rather
* than views/{step}.ctp.
*
* @var boolean
* @access public
*/
var $nestedViews = false;
/**
* Internal step tracking.
*
Expand Down Expand Up @@ -140,12 +148,15 @@ class WizardComponent extends Object {
*/
function initialize(&$controller, $settings = array()) {
$this->controller =& $controller;
$this->_set($settings);

$this->_sessionKey = $this->Session->check('Wizard.complete') ? 'Wizard.complete' : 'Wizard.' . $controller->name;
$this->_configKey = 'Wizard.config';
$this->_branchKey = 'Wizard.branches.' . $controller->name;
$this->_branchKey = 'Wizard.branches.' . $controller->name;

$this->_set($settings);
if ($this->nestedViews) {
$controller->viewPath .= '/' . $this->wizardAction;
}
}
/**
* Component startup method.
Expand Down

0 comments on commit 4d8b709

Please sign in to comment.