Inspekt and isset

4 views
Skip to first unread message

Julian

unread,
Aug 2, 2011, 10:32:46 AM8/2/11
to ins...@googlegroups.com
Hello,

I'm starting to use the Inspekt validation library.

Having trouble when combining with !isset.

if (!isset($input->get->program))               

(btw, $input is a SuperCage)

Seems the IF statement is not evaluating.

I see I have to use "getRaw" to retrieve the variable. When I use that I get a "Fatal error: Can't use method return value in write context"

if (!isset($input->get->getRaw('program')))

Anybody had this issue?

The page receives info thru GET and POST so I need to check which fields to validate. Using isset seemed the way to go. Would appreciate any other suggestions.



Ed Finkler

unread,
Aug 3, 2011, 3:30:55 PM8/3/11
to ins...@googlegroups.com
You can't use isset() with the return value of a method – it only works with variables.

Generally, you want to avoid using getRaw() -- the point of inspekt is to avoid directly handling raw input. The user docs may help you:

http://funkatron.com/inspekt/user_docs/

--
Ed Finkler
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

> --
> You received this message because you are subscribed to the Google Groups "inspekt" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/inspekt/-/cOBkUev_WYgJ.
> To post to this group, send email to ins...@googlegroups.com (mailto:ins...@googlegroups.com).
> To unsubscribe from this group, send email to inspekt+u...@googlegroups.com (mailto:inspekt+u...@googlegroups.com).
> For more options, visit this group at http://groups.google.com/group/inspekt?hl=en.


Reply all
Reply to author
Forward
0 new messages