logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Own Validators for Zend_Filter_Input: msg#00003

Subject: Re: Own Validators for Zend_Filter_Input
Hello,

I´ve tested your version and now my validator works fine but the problem is
that now the NotEmpty Validator doesn´t work any longer. If the value of
username is empty, the allowEmpty method doesn´t react and so the user could
have an empty username and that´s not how it should be^^

I hope you understand what I mean :)

Nilson



SiCo007 wrote:
> 
> Hi, I've had a quick look and it doesn't look like you specify your
> validator in the correct place in the array:
> 
> $validators = array(
> 'username' => array(
> 'allowEmpty' => false,
> 'Exists' => array(
> 'table' => 'user',
> 'name' => 'username'),
> 'breakChainOnFailure' => true,
> 'messages' => array(
> Nilson_Validate_Exists::EXISTS => 'Username existiert bereits'
> )
> ),............
> 
> If I remember rightly the validator needs to come first, and with an
> object you instantiate it first (although there are other ways too)...
> Then make $exists ($exists being your validator) the first entry in the
> array before specifying the parameters for the validation.
> 
> $exists = new Nilson_Validate_Exists('user', 'username');
> 
> $validators = array(
> 'username' => array($exists,
> 'allowEmpty' => false,
> 'breakChainOnFailure' => true,
> 'messages' => array(
> Nilson_Validate_Exists::EXISTS => 'Username existiert bereits'
> )
> ),............
> 
> Sorry the formatting is non existant but I hope it helps, also it's
> untested but I think I'm right. I've just done a very similiar validator
> to check for unique values in the table which I can send you if you like.
> 
> Simon
> 
> 
> Nilson wrote:
>> 
>> Hello everyone,
>> 
>> I´ve written a Validator that checks if a given value is already in the
>> database.
>> I tested the Validator a few times and im sure that he works fine.
>> When i use the validator like the following it works fine and i get the
>> error....
>> 
>> $peter = new Zend_Validate_Exists(array('name' => 'username', 'table' =>
>> 'user'));
>> $peter->isValid($this->_request->getParam('username'));
>> Zend_Debug::dump($peter);
>> 
>> But if I use the Validator with Zend_Filter_input I don´t get the Error
>> if the value is already in the Database.
>> 
>> Here is the Code how I use the Validator and the Code of the Validator.
>> 
>>  http://www.nabble.com/file/p14147565/Zend_Filter_Input_Issue_Nabble.php
>> Zend_Filter_Input_Issue_Nabble.php 
>> 
>> I hope you could understand my problem and perhaps that problem is
>> already known :)
>> 
>> Greetings Nilson
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Own-Validators-for-Zend_Filter_Input-tf4942091s16154.html#a14175994
Sent from the Zend Core mailing list archive at Nabble.com.




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe