Pluf Framework

Pluf Framework Commit Details


Date:2010-04-28 03:13:04 (14 years 7 months ago)
Author:Mehdi Kabab
Branch:develop, master
Commit:4753b98fde22fa9681c27152d99d0c196ea5a45b
Parents: 55a13cb2fd3f2dd8be9421ad0df675ac60db7765
Message:Simpler code for Pluf_HTTP_URL::generate()

Changes:

File differences

src/Pluf/HTTP/URL.php
4343
4444
4545
46
47
48
49
50
5146
52
53
54
55
56
57
58
47
48
5949
6050
6151
*/
public static function generate($action, $params=array(), $encode=true)
{
if ($encode) {
$amp = '&';
} else {
$amp = '&';
}
$url = $action;
if (count($params) > 0) {
$url .= '?';
$params_list = array();
foreach ($params as $key=>$value) {
$params_list[] = urlencode($key).'='.urlencode($value);
}
$url .= implode($amp, $params_list);
if (count($params)) {
$url .= '?' . http_build_query($params, '', ($encode) ? '&' : '&');
}
return $url;
}

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.05894s using 13 queries.