correct JRequest::getVar sequence?

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
ewel
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Mon Oct 01, 2007 11:35 am

correct JRequest::getVar sequence?

Post by ewel » Tue Jan 22, 2008 12:25 pm

Does anyone know if the bit between brackets below is in the right sequence?

$note_subject = JRequest::getVar('note_subject', 0, 'POST', 'STRING', _J_ALLOWHTML );

Thanks in advance!
Last edited by ewel on Tue Feb 05, 2008 6:48 pm, edited 1 time in total.

radiant_tech
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Sat Dec 15, 2007 3:02 pm
Location: Washington DC Metro

Re: correct JRequest::getVar sequence?

Post by radiant_tech » Tue Feb 05, 2008 6:37 pm

This should help.  From root/libraries/joomla/environment/request.php...

Code: Select all

    * The default behaviour is fetching variables depending on the
    * current request method: GET and HEAD will result in returning
    * an entry from $_GET, POST and PUT will result in returning an
    * entry from $_POST.
    *
    * You can force the source by setting the $hash parameter:
    *
    *   post      $_POST
    *   get      $_GET
    *   files      $_FILES
    *   cookie      $_COOKIE
    *   env      $_ENV
    *   server      $_SERVER
    *   method      via current $_SERVER['REQUEST_METHOD']
    *   default   $_REQUEST
    *
    * @static
    * @param   string   $name      Variable name
    * @param   string   $default   Default value if the variable does not exist
    * @param   string   $hash      Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
    * @param   string   $type      Return type for the variable, for valid values see {@link JFilterInput::clean()}
    * @param   int      $mask      Filter mask for the variable
    * @return   mixed   Requested variable
    * @since   1.5
    */
   function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
Denise


Post Reply