• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calling functions from the view file

#1
[eluser]jrlooney[/eluser]
Kinda new to CI and not sure why this doesn't work. If my controller looks like (not all functions shown - just the ones necessary for this example):

Code:
class Contact extends Controller
{
    private $uri_params = array();

    function Contact()
    {
        parent::Controller();
    }
    function get_sort_link($value)
    {
        $this->uri_params['sort'] = $value;
        return $this->uri->assoc_to_uri($this->uri_params);
    }
}

Why can I not do the following in the view file:

Code:
$this->get_sort_link('first_name');

This results in:

Fatal error: Call to undefined method CI_Loader::get_sort_link() in /Users/php/ci/contact_manager/views/contact_list_view.php on line 15


Messages In This Thread
calling functions from the view file - by El Forum - 09-04-2008, 05:25 AM
calling functions from the view file - by El Forum - 09-04-2008, 05:40 AM
calling functions from the view file - by El Forum - 09-04-2008, 05:44 AM
calling functions from the view file - by El Forum - 09-04-2008, 05:52 AM
calling functions from the view file - by El Forum - 09-04-2008, 09:12 AM
calling functions from the view file - by El Forum - 09-04-2008, 11:35 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.