Skip to content
defvayne23 edited this page Jan 4, 2012 · 1 revision

root

$this->root;

Full path to the website.

Returns

String

Example

echo $this->root;
// Returns: /src/website/public_html/

^ Back to Top

controller

$this->controller;

First part of the URL.

Returns

String

Example

// URL to page is http://example.com/blog/post/1/
echo $this->controller;
// Returns: blog

^ Back to Top

action

Description

$this->action;

Second part of the URL.

Returns

String

Example

// URL to page is http://example.com/blog/post/1/
echo $this->action;
// Returns: post

^ Back to Top

url

Description

$this->url;

Breakdown of the URL into an array.

Returns

Array

Example

// URL to page is http://example.com/blog/post/1/
print_r($this->url);

Will output:

Array
(
  [0] => blog
  [1] => post
  [2] => 1
)

^ Back to Top

param

Description

$this->param;

Combination of parameters found in the route patterns.

Returns

Array

Example

// URL to page is http://example.com/blog/post/1/
print_r($this->param);

URL is setup as: (app/config/routes.php)

'/blog/post/<id:[0-9]+>/' => array(
  'controller' => 'blog',
  'action' => 'view',
  'param' => array(
    'type' => 'post'
  )
)

Will output:

Array
(
    [type] => post
    [id] => 1
)

^ Back to Top

< Back to Index

Clone this wiki locally