> [mailto:[EMAIL PROTECTED] On Behalf Of brandags
> Wait - but don't I still need to send the validation rules,
> etc. to the
> view? Can you change what parameters are sent to the
> startup() function?
Well, here is your init function:
function init($validations=null, $data=null)
{
$formData = array('validations' => $validations, 'data'=>$data);
$this->controller->set('formData', $formData);
}
And you are calling it like this:
function beforeFilter()
{
$this->Myform->controller = &$this;
$this->Myform->init($this->User->validate, $this->data);
}
So you should be able to do this:
// seemed to work with preliminary testing...
function startup( &$controller )
{
$validations = array() ;
foreach( $controller->modelNames as $model )
{
$validations += $controller->$model->validate ;
}
$this->controller = $controller ;
$this->controller->set( 'formData', array(
'validations' => $validations,
'data' => $this->controller->data ) ) ;
}
--
Regards,
Ryan Ginstrom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---