Created
September 23, 2014 21:02
-
-
Save kylejohnson/0d94491b9f8d06c4dba2 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
| public function categories($category = null) { | |
| if ($category != null) { | |
| if (!$this->Config->find('first', array( 'conditions' => array('Config.Category' => $category)))) { | |
| throw new NotFoundException(__('Invalid Config Category')); | |
| } | |
| $config = $this->Config->find('all', array( | |
| 'conditions' => array('Config.Category' => $category), | |
| 'recursive' => 0 | |
| )); | |
| $config = $this->ConfigParser->parseOptions($config); | |
| $this->set(array( | |
| 'config' => $config, | |
| '_serialize' => array('config') | |
| )); | |
| } else { | |
| $categories = $this->Config->find('all', array( | |
| 'fields' => array('DISTINCT Config.Category'), | |
| 'conditions' => array('Config.Category !=' => 'hidden'), | |
| 'recursive' => 0 | |
| )); | |
| $this->set(array( | |
| 'categories' => $categories, | |
| '_serialize' => array('categories') | |
| )); | |
| } | |
| } | |
| public function keyValues() { | |
| $keyValues = $this->Config->find('list', array( | |
| 'fields' => array('Config.Name', 'Config.Value') | |
| )); | |
| $this->set(array( | |
| 'keyValues' => $keyValues, | |
| '_serialize' => array('keyValues') | |
| )); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment