Welcome Guest, Not a member yet? Register   Sign In
Anchor helper
#1

[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?
#2

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

InsiteFX
#3

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

[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
#5

[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.
#6

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




Theme © iAndrew 2016 - Forum software by © MyBB