To much functions! |
[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/adm...el/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/adm.../sumbitted Thanks //WebbHelp
[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.
[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 ![]()
[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!
[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). |
Welcome Guest, Not a member yet? Register Sign In |