Skip to content

Instantly share code, notes, and snippets.

@treffynnon
Created February 4, 2010 15:19
Show Gist options
  • Save treffynnon/294743 to your computer and use it in GitHub Desktop.
Save treffynnon/294743 to your computer and use it in GitHub Desktop.
Agavi: Form pre-population by ID
<?php
// With ID
$populate =& $this->getContext()->getRequest()->getAttribute('populate', 'org.agavi.filter.FormPopulationFilter');
$populate['form-id-1'] = new AgaviParameterHolder(array(
'question[0]' => 'Can you eat cheese?',
'answer[0]' => 'No'
));
$populate['form-id-2'] = new AgaviParameterHolder(array(
'question[0]' => "How many frags do I have to get before I'm considered awesome?",
'answer[0]' => 'At least 15'
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment