Add API function to find Config by Name
This commit is contained in:
parent
7a5ee71080
commit
c486cd0741
|
@ -47,6 +47,19 @@ class ConfigsController extends AppController {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function viewByName($name = null) {
|
||||||
|
$config = $this->Config->findByName($name, array('fields' => 'Value'));
|
||||||
|
|
||||||
|
if (!$config) {
|
||||||
|
throw new NotFoundException(__('Invalid config'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->set(array(
|
||||||
|
'config' => $config['Config'],
|
||||||
|
'_serialize' => array('config')
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* edit method
|
* edit method
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue