if you are adding 30+ controllers just for CRUD, think about abstracting the models into a MY_Model.php core file. Keep it DRY, it makes testing easier too.<div><br></div><div>Eric</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Nov 30, 2012 at 10:33 AM, keith smith <span dir="ltr"><<a href="mailto:klsmith2020@yahoo.com" target="_blank">klsmith2020@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><br>If I can avoid modifying the routing.php script that would be great. <br><br>I watched both video's that were on the old CI site, read lots of posts on Google, and have a book that I read cover to cover. <br>
<br>I have not found any real in-dept info on CI routing.<br><br>Thanks for your help!! <br><br>------------------------<br>
Keith Smith<br><br>--- On <b>Fri, 11/30/12, Tom Haws <i><<a href="mailto:tom.haws@gmail.com" target="_blank">tom.haws@gmail.com</a>></i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px">
<br>From: Tom Haws <<a href="mailto:tom.haws@gmail.com" target="_blank">tom.haws@gmail.com</a>><div class="im"><br>Subject: Re: OT: CodeIgniter Routing<br></div>To: "Main PLUG discussion list" <<a href="mailto:plug-discuss@lists.phxlinux.org" target="_blank">plug-discuss@lists.phxlinux.org</a>><br>
Date: Friday, November 30, 2012, 9:53 AM<div><div class="h5"><br><br><div>Yeah. Keep researching CodeIgniter tutorials, because ideally, you wouldn't ever need to use routes.php unless you had a need for an alias or some other special occasion.<br>
<br>On another note, it would be more conventional to talk to your database tables in model files and then call model functions in your controllers. Again, I recall watching a short CodeIgniter tutorial video that really helped clarify this.<br>
<div><br clear="all">--<br>"To forgive is the highest, most beautiful form of love. In return, you will receive untold peace and happiness." - Dr. Robert Muller<br>
<br><br><div>On Fri, Nov 30, 2012 at 9:36 AM, Eric Cope <span dir="ltr"><<a rel="nofollow" href="http://mc/compose?to=eric.cope@gmail.com" target="_blank">eric.cope@gmail.com</a>></span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You can just put your controller "pages" in the controller/cp directory...<div><br></div><div>Then you don't have to muck with the routes...</div><div><br></div><div>Eric</div><div><br><br>
<div><div><div>On Fri, Nov 30, 2012 at 9:20 AM, keith smith <span dir="ltr"><<a rel="nofollow" href="http://mc/compose?to=klsmith2020@yahoo.com" target="_blank">klsmith2020@yahoo.com</a>></span> wrote:<br></div></div>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top"><br><br>Hi,<br><br>I'm rather new to CodeIgniter. I'm using version 2.0.3 and am using the provided .htaccess code to remove index.php from the URL. <br>
<br>I'm working on a control panel and would like to set up a controller for each table to keep things simple and modular. (any feedback on a better idea is much appreciated)<br><br>I was thinking I needed to configure the controllers this way<br>
<br>1) $route['cp/pages/(:any)'] = "cp_pages"; (would contain only controller code for managing the pages table.)<br><br>2) $route['cp/users/(:any)'] = "cp_users"; (would contain only controller code for managing the users table.)<br>
<br>.... other table configured with their own control panel.<br><br>3) $route['cp/'] = "cp"; (splash page and menu. If not logged in presents the log in form)<br><br>/cp/ gives me the splash page. so far so
good.<br><br>/cp/pages - cp controller - not what I was expecting. I was wanting the index function of the cp_pages controler.<br><br>/cp/pages/list/ - takes me to the cp_pages controller / index function<br><br>What I would like to configure is:<br>
<br>/cp/ - use cp controller<br><br>/cp/pages/ - use the cp_pages controller / index function<br>/cp/pages/add/ - use the cp_pages controller / add function <br>/cp/pages/list - use the cp_pages controller /list function<br>
/cp/pages/list/10 - use the cp_pages controller /list function with segment set to 10 as starting point.<br><br>If I'm going down the wrong path please let me know.<br><br>Thank you! <br><br><br>------------------------<br>
Keith Smith</td></tr></tbody></table><br></div></div>---------------------------------------------------<br>
PLUG-discuss mailing list - <a rel="nofollow" href="http://mc/compose?to=PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a rel="nofollow" href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a rel="nofollow" href="http://mc/compose?to=PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a rel="nofollow" href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>
</div><br></div></div>-----Inline Attachment Follows-----<div class="im"><br><br><div>---------------------------------------------------<br>PLUG-discuss mailing list - <a href="http://mc/compose?to=PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br><a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></div></div></blockquote>
</td></tr></tbody></table><br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>