Creating pages - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Creating pages (/showthread.php?tid=29948) |
Creating pages - El Forum - 04-27-2010 [eluser]Dizza[/eluser] Hey everyone, I am new to codeigniter so thats probably why i ask this noobish question The thing is that i am making a CMS, i can add manage and delete posts. But i also want to add, delete and update pages through the CMS. So i make a page @ the cms and at the frontend there is a new menu item with the new webpage. Is there a library class for this? I searched everywhere but i cant find it. Thanks! Creating pages - El Forum - 04-27-2010 [eluser]harman[/eluser] hi dizza, first you need to understand Ci URI structure e.g http://your-host/Controller/your_function/param1 for new post http://your-host/Controller/posts/newpost1 here 'posts()' is function and 'newpost1' its parameter Code: function posts(parameter){ Code: <a href=" http://your-host/Controller/posts/newpost1">new post</a> Creating pages - El Forum - 04-27-2010 [eluser]Dizza[/eluser] Thank you, but this is just for posts right? This is the part that i already have. I want to know how to make pages. I think i need a framework, but how can i write/create a new page? Is this with the same structure as above? Creating pages - El Forum - 04-27-2010 [eluser]harman[/eluser] Off course You Can Just Change Your "View" Creating pages - El Forum - 04-27-2010 [eluser]slowgary[/eluser] What's the difference between a post and a page? Nothing? Creating pages - El Forum - 04-27-2010 [eluser]Caio Russo[/eluser] hi dizza. Let's see with I understand your need: you have the controller: Code: function showPosts(){ and at your view you work with the array that now is called $posts. is that? Caio Russo Creating pages - El Forum - 04-27-2010 [eluser]Mischievous[/eluser] Use a controller such as this: Code: <?php Then in your routes file inside your config directory set this up -> Code: $route[':any'] = 'page'; For your model run something like this: Code: <?php This code isn't tested and is only for demonstration purposes only... to simply point you in the right direction. Hope this helps you out some. Creating pages - El Forum - 04-27-2010 [eluser]srpurdy[/eluser] This is designed to work with freakauth so, it's just an example of admin side controls pretty straight forward. You can also write a query in the model to just display your Page Names (titles) in a css designed menu pretty easly. This code is a bit old, but should get you in a decent direction. It's like everyone has said, it's not any different than making a blog post with info on it. I should mention I have my model auto loaded when ci runs, so you'll need too define that either at the top of the controller or autoload it. Controller Code: <?php Model Functions Code: //Page Admin Creating pages - El Forum - 04-28-2010 [eluser]Dizza[/eluser] Hey all, thanks for the reply's! Im going to test a few of these solutions you gave. In the meanwhile i have found an example of what i mean with creating pages (not codeigniter): http://www.subdreamer.com/demo/admin/pages.php < here you can create a new webpage and also edit, update and delete it. This is what i meant with creating pages Im sorry if im not clear enough, english is not my main language. Creating pages - El Forum - 04-28-2010 [eluser]Caio Russo[/eluser] Oh, you wanted for Scaffolding functions. Caio |