Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
sjlu edited this page May 29, 2012 · 1 revision

The URL Helper extends the current CodeIgniter URL helper. This helper is also auto-loaded. http://codeigniter.com/user_guide/helpers/url_helper.html

is_active($uri)

is_active will return true or false based on if the inputted URI is contained in the current URI. The inputted URI does not need to be full. For example /api/func/ will match /api/func/1. This function is useful when needing to call class="active" on elements of HTML.

get_controller(), get_function(), get_parameters()

These functions will split up the URI and output them in a readable format for you. For exmaple, CI URLs are typically made in a way such as /controller/function/param1/param2/. These functions will split these up for you so that for example, all you want is the current paramenters, you would not need to parse the entire URL by yourself.

get_parameter($part)

part is an integer and will return the specific parameter asked for.

Clone this wiki locally