CodeIgniter Forums

Full Version: Anchor helper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]minim[/eluser]
Hye all,

I'm having problem to call the controller function from my view. I got error Object not found!.
Even though, I have followed step by step of tutorial. Here my code:

View: <?php echo anchor('usercontoller/new/','add new data',array('class'=>'add')); ?>

Controller: function new(){
// set common properties
$data['title'] = 'Add new person';
$data['message'] = '';

// load another view
$this->load->view('new', $data);
Any Idea?

El Forum

[eluser]InsiteFX[/eluser]
Take the ending slash off!

InsiteFX

El Forum

[eluser]minim[/eluser]
Tq for ur reply, but somehow doesn't w0rk for me...I'm using CI 2.01

El Forum

[eluser]danmontgomery[/eluser]
new is a reserved keyword in PHP, you can't have a method, class, etc named new().

http://www.php.net/manual/en/reserved.keywords.php

El Forum

[eluser]minim[/eluser]
Ok tq. I've changed to add but till now can't solved the error..Object not found! ;-(. Anything i've missed.

El Forum

[eluser]JonoB[/eluser]
I bet that your controller is not actually called "usercontoller"