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 44]
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


constructor url [line 60]

url url( [boolean $enabled = true])

Constructor



Parameters:

boolean   $enabled   whether rewriting is enabled

[ Top ]

method buildURL [line 210]

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 _isenabled is true otherwise original url


Parameters:

string   $url   URL to try and convert

[ Top ]

method getArgument [line 178]

mixed getArgument( string $name)

Gets the value for an argument



Tags:

return:  returns value for a given argument


Parameters:

string   $name   Name of argument to fetch value for

[ Top ]

method isEnabled [line 125]

boolean isEnabled( )

Returns whether or not URL rewriting is enabled



Tags:

return:  true if URl rewriting is enabled, otherwise false


[ Top ]

method numArguments [line 138]

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


[ Top ]

method setArgNames [line 150]

boolean setArgNames( array $names)

Assigns logical names to query string variables



Tags:

return:  true on success otherwise false


Parameters:

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

[ Top ]

method setEnabled [line 110]

void setEnabled( boolean $switch)

Enables url rewriting, otherwise URL's are passed back



Parameters:

boolean   $switch   turns URL rewriting on/off

[ Top ]


Documentation generated on Thu, 24 May 2012 02:09:27 -0400 by phpDocumentor 1.4.3