![]() |
To much functions! - 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: To much functions! (/showthread.php?tid=25390) |
To much functions! - El Forum - 12-10-2009 [eluser]WebbHelp[/eluser] Hi! I am making a adminpanel, a pretty simple one. But I just saw that it is pretty many functions and I need to scroll a bit to find a function. I just wonder... In my controller file, can I "include" other functions from a file in a smart way? or maybe I just should create more pages? The thing I don't like is that the adressfield got a big length: http://www.webbhelp.se/cms/index.php/admin/panel/addpage Maybe this isn't that long, but it is pretty long hehe, the thing is, if a use a new page, I need to put 1 segments more like: http://www.webbhelp.se/cms/index.php/admin/panel/addpage/sumbitted Thanks //WebbHelp To much functions! - El Forum - 12-10-2009 [eluser]überfuzz[/eluser] Sounds like a clear case of overkill. Give us a clips of the code. Otherwise it's hard to say anything about your code. To much functions! - El Forum - 12-10-2009 [eluser]WebbHelp[/eluser] Here is a little bit of code... Code: function editpage() I think I know the problem hehe, in another thread in this forum, a user told me to use models... I saw a tutorial, a movie-tutorial, he sad that models was the old way, so… I have never used it :S Maybe that is the problem? Thanks ![]() EDIT: Maybe it is all the comments to ![]() To much functions! - El Forum - 12-10-2009 [eluser]jedd[/eluser] Can you elucidate on what your actual problem is? To much functions! - El Forum - 12-10-2009 [eluser]WebbHelp[/eluser] yes, it was a problem before, but now I know, I need to learn about models ![]() like I sade before: I saw a tutorial, a movie-tutorial, he sad that models was the old way, so… I have never used it :S My question was why I got so much function, because I heard that codeigniter would be very clean and things like that and I thought I did wrong! To much functions! - El Forum - 12-10-2009 [eluser]mattpointblank[/eluser] If your editpage() function uses the validation rules in submitedit(), you may as well combine them into one function and have the form submit to itself - the validation class is built to work like this. And yeah, use models. Keep your database code separate from your processing code (and keep your views/styling separate from these as well). |