Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Class: Url

Source Location: /system/classes/url.class.php

Class Overview


This class will allow you to use friendlier URL's, like: http://www.example.com/index.php/arg_value_1/arg_value_2/ instead of uglier http://www.example.com?arg1=value1&arg2=value2.


Author(s):

Methods



Class Details

[line 43]
This class will allow you to use friendlier URL's, like: http://www.example.com/index.php/arg_value_1/arg_value_2/ instead of uglier http://www.example.com?arg1=value1&arg2=value2.

NOTE: this does not currently work under windows as there is a well documented bug with IIS and PATH_INFO. Not sure yet if this will work with windows under apache. This was built so you could use this class and just disable it if you are an IIS user.




Tags:

author:  Tony Bibbs <tony@tonybibbs.com>


[ Top ]


Class Methods


static method getInstance [line 60]

static void getInstance( [ $enabled = true])



Tags:

access:  public


Parameters:

   $enabled  

[ Top ]

constructor __construct [line 80]

Url __construct( [bool $urlRewrite = true], [int $urlRouting = Router::ROUTING_DISABLED])

Constructor



Tags:

access:  public


Parameters:

bool   $urlRewrite   whether rewriting is enabled
int   $urlRouting   URL routing mode, see Router class

[ Top ]

method buildURL [line 174]

string buildURL( string $url)

Builds crawler friendly URL if URL rewriting is enabled This function will attempt to build a crawler friendly URL. If this feature is disabled because of platform issue it just returns original $url value



Tags:

return:  rewritten if $this->urlRewrite is true otherwise original url
access:  public


Parameters:

string   $url   URL to try and convert

[ Top ]

method getArgument [line 144]

mixed getArgument( string $name)

Gets the value for an argument



Tags:

return:  returns value for a given argument
access:  public


Parameters:

string   $name   Name of argument to fetch value for

[ Top ]

method numArguments [line 104]

int numArguments( )

Returns the number of variables found in query string This is particularly useful just before calling setArgNames() method



Tags:

return:  Number of arguments found in URL
access:  public


[ Top ]

method setArgNames [line 115]

boolean setArgNames( array $names)

Assigns logical names to query string variables



Tags:

return:  true on success otherwise false
access:  public


Parameters:

array   $names   String array of names to assign to variables pulled from query string

[ Top ]


Documentation generated on Sun, 02 Oct 2016 07:56:37 +0000 by phpDocumentor 1.4.3