Created
November 4, 2012 21:12
-
-
Save graphis/4013800 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| class Kostache_Layout_Base extends Kostache_Layout | |
| { | |
| protected $_options_title_selected = null; | |
| /** | |
| * Returns an options list of titles. | |
| * | |
| * @return array | |
| */ | |
| public function options_title() | |
| { | |
| return array( | |
| array( | |
| 'value' => 'Dr', | |
| 'option' => 'Dr', | |
| 'selected' => ($this->_options_title_selected == 'Dr'), | |
| ), | |
| array( | |
| 'value' => 'Mr', | |
| 'option' => 'Mr', | |
| 'selected' => ($this->_options_title_selected == 'Mr'), | |
| ), | |
| array( | |
| 'value' => 'Miss', | |
| 'option' => 'Miss', | |
| 'selected' => ($this->_options_title_selected == 'Miss'), | |
| ), | |
| array( | |
| 'value' => 'Ms', | |
| 'option' => 'Ms', | |
| 'selected' => ($this->_options_title_selected == 'Ms'), | |
| ), | |
| array( | |
| 'value' => 'Mrs', | |
| 'option' => 'Mrs', | |
| 'selected' => ($this->_options_title_selected == 'Mrs'), | |
| ), | |
| ); | |
| } | |
| } |
This file contains hidden or 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
| <option></option> | |
| {{#options_title}} | |
| <option value="{{value}}" {{#selected}}selected="selected"{{/selected}}>{{option}}</option> | |
| {{/options_title}} |
This file contains hidden or 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
| <?php | |
| class View_Signup extends View_Signup_Base | |
| { | |
| protected $_partials = array( | |
| 'title' => 'layouts/partials/person/title', | |
| ); | |
| public function __construct($template = NULL, array $partials = NULL) | |
| { | |
| parent::__construct($template, $partials); | |
| $this->_account = $this->_get_account(); | |
| } | |
| protected function _get_account() | |
| { | |
| $session_account = Arr::get(Session::instance()->get('signup', array()), 'account'); | |
| // ... | |
| $this->_options_title_selected = Arr::get($session_account, 'title'); | |
| // ... | |
| } | |
| } |
This file contains hidden or 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
| <?php | |
| class View_Signup_Base extends Kostache_Layout_Base | |
| { | |
| // ... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment