Development

Changeset 8537

You must first sign up to be able to contribute.

Changeset 8537

Show
Ignore:
Timestamp:
04/18/08 20:14:31 (2 years ago)
Author:
fabien
Message:

added sfWebRequest ::getGetParameter() ::getPostParameter() and ::getUrlParmaeter() methods

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/request/sfWebRequest.class.php

    r8263 r8537  
    990990 
    991991  /** 
     992   * Returns the value of a GET parameter. 
     993   * 
     994   * @param  string The GET parameter name 
     995   * @param  string The default value 
     996   * 
     997   * @return string The GET parameter value 
     998   */ 
     999  public function getGetParameter($name, $default = null) 
     1000  { 
     1001    if (isset($this->getParameters[$name])) 
     1002    { 
     1003      return $this->getParameters[$name]; 
     1004    } 
     1005    else 
     1006    { 
     1007      return sfToolkit::getArrayValueForPath($this->getParameters, $name, $default); 
     1008    } 
     1009  } 
     1010 
     1011  /** 
     1012   * Returns the value of a POST parameter. 
     1013   * 
     1014   * @param  string The POST parameter name 
     1015   * @param  string The default value 
     1016   * 
     1017   * @return string The POST parameter value 
     1018   */ 
     1019  public function getPostParameter($name, $default = null) 
     1020  { 
     1021    if (isset($this->postParameters[$name])) 
     1022    { 
     1023      return $this->postParameters[$name]; 
     1024    } 
     1025    else 
     1026    { 
     1027      return sfToolkit::getArrayValueForPath($this->postParameters, $name, $default); 
     1028    } 
     1029  } 
     1030 
     1031  /** 
     1032   * Returns the value of a parameter passed as a URL segment. 
     1033   * 
     1034   * @param  string The parameter name 
     1035   * @param  string The default value 
     1036   * 
     1037   * @return string The parameter value 
     1038   */ 
     1039  public function getUrlParameter($name, $default = null) 
     1040  { 
     1041    if (isset($this->requestParameters[$name])) 
     1042    { 
     1043      return $this->requestParameters[$name]; 
     1044    } 
     1045    else 
     1046    { 
     1047      return sfToolkit::getArrayValueForPath($this->requestParameters, $name, $default); 
     1048    } 
     1049  } 
     1050 
     1051  /** 
    9921052   * Parses the request parameters. 
    9931053   * 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.