Welcome Guest, Not a member yet? Register   Sign In
i am facing 404_error when i press the edit button
#2

(This post was last modified: 07-08-2019, 12:23 PM by Wouter60.)

The edit method in your controller is expecting an argument ($slug).
The button in your view doesn't pass any argument:

PHP Code:
<class="btn btn-default pull-left" href="<?php echo base_url(); ?>posts/edit/">Edit</a

Load (or autoload) the url helper and change it to:
PHP Code:
<?= anchor('posts/edit/' $post['slug'], 'Edit''class="btn btn-default pull-left"');?>

The anchor function will automatically insert the site_url() (not the base_url()) into the href part.
Reply


Messages In This Thread
RE: i am facing 404_error when i press the edit button - by Wouter60 - 07-08-2019, 11:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB