> Date: Mon, 23 Feb 2009 07:44:02 +0000
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [fw-general] Detect empty request params?
> 
> On 23/02/2009 07:16, [email protected] wrote:
> > Hi all,
> > Is there any way to tell if an url parameter is present, even when it
> > has no value? Something like paramExists()?
> > Consider this example:
> > http://www.example.com/newsletter/subscribe/
> > controller: newsletter
> > action: subscribe
> >
> > http://www.example.com/newsletter/subscribe/verify
> > controller: newsletter
> > action: subscribe
> > verify: null
> >
> > $request->getParam( 'verify' ); // null, as expected
> > $request->paramExists( 'verify' ); // true
> > Thank you for any pointers.
> 
> Try $request->has('verify');
> 
> Regards,
> 
> Rob...

Hi Rob,
It doesn't work I'm afraid. With...
http://www.example.com/newsletter/subscribe?verify // notice use as GET 
parameter
... it does work though. I was hoping for the URI segment solution though.
Any other pointers much appreciated.
Come to think of it, it does make some sense though. With ZF's implementation 
only the last URI segment could be representing an empty/null value. Otherwise 
ZF wouldn't be able to distinguish between key/value pairs anymore. I wish 
there was an ability to disable key/value URL segments though. And just let 
additional URI segments be put in an indexed array without having to resort to 
routes. Who knows, maybe I'll write a proposal for this at some point, or 
submit it in the issue tracker.
Cheers

_________________________________________________________________
De leukste online filmpjes vind je op MSN Video!
http://video.msn.com/video.aspx?mkt=nl-nl

Reply via email to