If you're using CodeIgniter 3, you'll have to include the helper for this function to work. Here's how to enable it for the whole site:
In the file application/config/autoload.php, add 'url' to the list of helpers:
$autoload['helper'] = array('url');
To enable it on a page by page basis, put this in the constructor function of your controller - or at the very least, at the top of the page you're using.
$this->load->helper('url');
Also (sorry if you already know this), with CodeIgniter, you know you should access views through the controller, not directly. For example, in a codeigniter app, www.example.com/admin/users.php would route to a controller file called 'admin' and in that controller there would be a function called 'users' which would load a view like this $this->load->view('some_directory/users', $data);