Skip to content

Instantly share code, notes, and snippets.

@kylejohnson
Created May 5, 2013 15:23
Show Gist options
  • Select an option

  • Save kylejohnson/5521104 to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnson/5521104 to your computer and use it in GitHub Desktop.
My Config View and the associated returned array structure
<h2>Configs</h2>
<?php
echo $this->Form->create('Config', array(
'url' => '/config/edit'
));
foreach ($configs as $config):
$inputname = "Config.";
$inputname.= $config['Config']['Id'];
$inputname.= ".";
$inputname.= $config['Config']['Name'];
echo $this->Form->input($inputname, array(
'default' => $config['Config']['Value'],
'label' => $config['Config']['Name'],
'after' => $config['Config']['Prompt'],
));
echo $this->Form->input( "Config." . $config['Config']['Id'] . '.Id', array('type' => 'hidden'));
endforeach;
unset($config);
echo $this->Form->end('Save Config');
?>
</table>
Array
(
[Config] => Array
(
[25] => Array
(
[ZM_TIMESTAMP_ON_CAPTURE] => 1
[Id] =>
)
[26] => Array
(
[ZM_CPU_EXTENSIONS] => 1
[Id] =>
)
[27] => Array
(
[ZM_FAST_IMAGE_BLENDS] => 1
[Id] =>
)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment