3 * TODO: if (stristr ($topic, '~')) {
6 * $title = substr($topic, 1);
9 // will generate : http://base_url/topic/major/title/minor1/1/minor2/2
10 define ('FRIENDLY' , 1);
11 // will generate : http://base_url/?NAV_VAR=topic&major=title&minor1=1&minor2=2
12 define ('REGULAR' , 2);
15 * Object to generate URLs
19 public $options = array ();
20 private $method = REGULAR
;
25 protected $topic, // REGULAR : NAV_VAR=$topic | FRIENDLY : /$topic/
26 $major, // REGULAR : &$major=$title
27 $title, // FRIENDLY : ../$major/$title
30 public function __construct ($opt = null) {
32 if (defined('BASE_URL'))
33 $options['base'] = BASE_URL
;
35 $options['base'] = '';
40 public function __destruct () {
45 * method to return the url as a string
48 public function __toString () {
53 * method to generate an friendly URL slug
55 public function buildSlug () {
60 * method to return the URL based on $method
62 * TODO: find a method to overlook folders
64 public function setRequest () {
65 // generating friendly URLs
66 if ($this->method
== FRIENDLY
) {