Fantastic..That worked..thank you Matthew.
my final struggle is this
foreach ($this->_campaignCreateForm->getMessages() as $message)
{
$this->flash(("Invalid Data: $message\n"), 'error',
'/advertiser/create-campaign');
}
returns the flash message, but the $message is simply an Array, and not the
message set in the ini. So i think im confused there as well
these are the messages i have set in the ini based on the particular
validation.
advertiser.campaignCreate.elements.name.options.validators.notempty.options.messages.isEmpty
= "A Campaign Name required."
advertiser.campaignCreate.elements.name.options.validators.alpha.options.messages.notAlpha
= "Invalid Campaign Name. Can only contain letters."
Matthew Weier O'Phinney-3 wrote:
>
> -- Bob O <[email protected]> wrote
> (on Saturday, 14 February 2009, 05:54 PM -0800):
>>
>> If anyone could point me in a good direction that would be great
>>
>> Im trying to get this form to validate
>
> <snip - INI and view code>
>
>> this is my Controller code -
>>
>> $config = new Zend_Config_Ini(APPLICATION_PATH .
>> '/config/campaignCreateForm.ini');
>> $this->_campaignCreateForm = new
>> Zend_Form($config->advertiser->campaignCreate);
>>
>> But im at a loss as to how the validations work?
>
> In your controller, pass data from the request to the form's isValid()
> method:
>
> if
> ($this->_campaignCreateForm->isValid($this->getRequest()->getPost())) {
> // Validates!
> }
>
> --
> Matthew Weier O'Phinney
> Software Architect | [email protected]
> Zend Framework | http://framework.zend.com/
>
>
-----
Bob Hanson
Web Developer
SLC, UT
--
View this message in context:
http://www.nabble.com/Zend_Form%2C-Validators-%2C-Filters%2C-and-ini-files-tp22019106p22045553.html
Sent from the Zend Framework mailing list archive at Nabble.com.