Forum Moderators: coopster
[php.net...]
as for looking at what pear actually does, i'm not shy of digging in and looking, in fact i have been doing so and have been using the 'manual' such as it is - there seems to be very little tutorials online or those that are are so symplistic and don't actually explain why they are doing something ... just the
do this
do that
here's the result type tutorial (not much use really)
i've never done any OOP in my life before and even the syntax is pretty overwhelming for me at this point, although more understandable than it was yesterday ... so show some mercy :)
no the rules are built in, i've written
$form->addRule('picSm','maxfilesize',50000);
$form->addRule('picSm','mimetype',array('jpg','jpeg','gif','png'));
where picSm is the form field name.
the default is server side validation, if i'd added client
$form->addRule('picSm','mimetype',array('jpg','jpeg','gif','png'),'client');
then it would be client side validation and presumably the created js would just check the mime type.
i'm thinking that maybe it just checks the http mime type, but given that it is not too difficult to check if the file truly is an image type i was thinkng it should validate it.
it's gettign better, although this whole
=> -> :: : syntax stuff is still strange
I am guessing that it just checks mime type from reading through a bunch of the validation functions. I didn't read through all the thousands of lines of code, it would just take too long. ;)