CodeIgniter Forums
add_clients - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: add_clients (/showthread.php?tid=65602)



add_clients - davy_yg - 06-29-2016

views/clients.php

PHP Code:
<button type="button" class="add" href="<?php echo site_url('cpages/addclients'); ?>">ADD CLIENTS</button


controllers/cpages.php

PHP Code:
    public function addclients() { $this->load->view('addclients'); } 


config/routes.php

PHP Code:
/* routes addclients */

$route['cpages/addclients'] = 'cpages/addclients'


Hello,

Can anyone help me figure out why the button add client I am unable to move to another pages?

Thanks in advance.


RE: add_clients - abhijeetgk - 06-29-2016

Any error log or error message displayed on screen will help to resolve issue.


RE: add_clients - salain - 06-30-2016

To answer you exact question, it doesn't work because your code is wrong.
href is not a valid attribute of a button. use link tag <a href....> or change href for onclick="location.href='url';"

You don't need the route as your link is exactly the same as controller/method.


RE: add_clients - freddy - 06-30-2016

just show complete controller and view ?
adn you make router it will not change anything if you write like that which is alias and manipulate same,