Return specific configs as an HTML <form> in API

This commit is contained in:
Kyle Johnson 2014-11-20 04:04:23 +00:00
parent 4298d4a498
commit 408c6111b8
1 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class ConfigsController extends AppController {
* *
* @var array * @var array
*/ */
public $components = array('RequestHandler'); public $components = array('RequestHandler', 'ConfigParser');
/** /**
* index method * index method
@ -95,6 +95,7 @@ class ConfigsController extends AppController {
* *
* Either return a list of distinct categories * Either return a list of distinct categories
* Or all configs under a certain category * Or all configs under a certain category
* If we want only one category, format it as HTML
*/ */
public function categories($category = null) { public function categories($category = null) {
@ -107,6 +108,9 @@ class ConfigsController extends AppController {
'conditions' => array('Config.Category' => $category), 'conditions' => array('Config.Category' => $category),
'recursive' => 0 'recursive' => 0
)); ));
$config = $this->ConfigParser->parseOptions($config);
$this->set(array( $this->set(array(
'config' => $config, 'config' => $config,
'_serialize' => array('config') '_serialize' => array('config')
@ -135,3 +139,4 @@ class ConfigsController extends AppController {
)); ));
} }
} }