![]() |
Abour the URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Abour the URL (/showthread.php?tid=60836) |
Abour the URL - El Forum - 07-09-2014 [eluser]BobyKurniawan[/eluser] Hi, it's me again, now i want to ask about the url (I dont how to name it). I try to create my own CMS. First, i already make a article just for a test, this how to see the list of my article via url bar Code: http://localhost/framecode/admin/artikel admin controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Then the lists of my articles will show up, now i want to see the article so i make a other controller like this -> Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); this is the link from my view Code: <td class="action" ><a class="view">slug;?>">View</a><a class="edit">idartikel;?>">Edit</a> <a class="delete">idartikel;?>">Delete </a></td> well it's work when i click 'view' from the link. Then my url bar change to this Code: http://localhost/framecode/view/artikel/tes-new-cat The problem is, if i chaenge 'tes-new-cat' to -> 'sdasad', this message is show up Message: Trying to get property of non-object sorry for very bad english Abour the URL - El Forum - 07-10-2014 [eluser]CroNiX[/eluser] I don't know why it works using Code: http://localhost/framecode/view/artikel/tes-new-cat because in your View controller, the method name is artikelview, not "artikel", so the link should be Code: http://localhost/framecode/view/artikelview/tes-new-cat Code: http://localhost/framecode/view/artikelview/sdasad Abour the URL - El Forum - 07-16-2014 [eluser]BobyKurniawan[/eluser] sorry, i copy wrong source code. Everythings work know. i add this to my view Code: if(count($artikel)): foreach($artikelas $baris): Can i do that wat? |