Codeigniter:function Anchor

Asked

Viewed 367 times

3

I’m starting with Codeigniter, I use version 2.2 and I’m having problems using the function anchor.

The following error occurs:

Fatal error: Call to Undefined Function Anchor()

I don’t know if the reason is the version or something like that, if someone can help me or speak another function that can use with the same result, thank you.

  • Did you actually load the helper url in the place where it is calling the anchor? In autoload or controller? Put a little more detail.

  • Where does this error happen in your code? Post a little code for us. See [Ask] and make a [tour].

1 answer

1

Check the file autoload.php in the briefcase config or in his controller and place the following function:

<?php
    function __construct(){
        parent::__construct();
        $this->load->helper('url'); 
    }
?>
  • Oi Renato, I tested both in autoload and controller, but it didn’t work. Could be some version problem?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.