CodeIgniter Forums
CMS - Couple of questions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: CMS - Couple of questions (/thread-12560.html)

Pages: 1 2


CMS - Couple of questions - El Forum - 10-23-2008

[eluser]Boris Strahija[/eluser]
I'm really new to CI, and I currently have my own CMS in development. It's about 50% done, but now I decided I would rewrite it in for CI.
And I'm curious about some things, best practive for a couple of things.

1. Authentication library and user management. What do you think is the best practice to do this? A library wit all the functionality and a model to do DB stuff, or how? How du you do it?

2. I also have a template parser that dynamcly adds parsed elements to the DB. It's divided in 3 tables. Is it better to make a library for this, or maybe a template model, that then loads the other 2 models for the other 2 tables?

Thank you


CMS - Couple of questions - El Forum - 10-23-2008

[eluser]Derek Allard[/eluser]
Best practice for something like auth and user management will really depend on what you're building. There are a number of CI based CMS systems out there, most open source. I'd suggest you download and dissect one. Depending on your needs, you may also want to look at ExpressionEngine. It may be overkill for you, or it may save you weeks (in our case years) of development time. Welcome to CI strija!


CMS - Couple of questions - El Forum - 10-23-2008

[eluser]Boris Strahija[/eluser]
Which CMS systems do you mean? Somethign like Blaze? Came up first on google Smile
EE is of course nice, and I have some plans to use it on a couple of projets, but I would also like to make my own CMS, not very complicated just for some really simple sites. And I would also learn to know CI a little bit better.

What I would like to achieve is to have to have some basic functions like login, register, edit, delete. Users have to be divided in groups, and also one of the requirements is that some users only have access to some parts of the published site. In the backend there have to be some user management pages.
This is what I would like to know, best practices?

And on the template part, do you maybe have some suggestion or advice? Smile

Thanx


CMS - Couple of questions - El Forum - 10-23-2008

[eluser]Derek Allard[/eluser]
Yeah, Blaze is one, I think there are a few. Truthfully, I'm drawing a blank on the other names right now (long day), but they're out there.

Regarding the template part - I'm not sure. My knee-jerk reaction would be to do it in a model, but depending on how you're using it, a full on library may be better. I guess my answer is "depends" which was why I kinda avoided that part of your post (all stealthy like a ninja).


CMS - Couple of questions - El Forum - 10-23-2008

[eluser]alectrash[/eluser]
i deseceted freak auth light in my project by 4webby. really simple and fun, though I am a massive CI geek, watch out dereck..(i wish)


CMS - Couple of questions - El Forum - 10-23-2008

[eluser]Sarfaraz Momin[/eluser]
If you would like a more robust and professional approach check out Webber (www.drsoft.com). I have used it in one of the projects to be deployed soon and am using it in one more project right now. Looks very convincing and very extendable and flexible. Take a look at it and you would definately love it.

Have a good day !!!


CMS - Couple of questions - El Forum - 10-24-2008

[eluser]Boris Strahija[/eluser]
Thanks, I'm gonna check out all the suggestions. Actually I'm trying to do everything on my own, but looking into the code of other apps is always helpfull. This is basicly because I want to learn more about CI.I just think it would best fit in my worklow.

I think I will make a library for the authentication and user managements, and in there I'll load the models for the tables. I think it's the best way way for me to go.

And the template parser, I'm not really sure about this one yet, but maybe the same approach would be good, library + models.

What do you think?


CMS - Couple of questions - El Forum - 10-24-2008

[eluser]Pascal Kriete[/eluser]
I'm with Derek. It really depends, particularly for the parser.

For user authentication I usually write a library to do the logic and then have a user model to deal with the db. I've tried putting it all into the library, but it always ends up being sort of messy. I personally prefer having short files and short functions in exchange for a lot of them.

Since the parser will have quite a bit of logic, I would definitely start with a library. Whether or not it warrants an additional model depends on how much database manipulation it has to do. If you only need 2 database functions, then that it's probably easiest to keep them in the library. Short files are great, but there is a point where fragmentation begins.

Have fun Smile .


CMS - Couple of questions - El Forum - 10-24-2008

[eluser]Boris Strahija[/eluser]
Ok, thanks for the answers.
If I understand correctly, it's 1 model for every table. Is it then bad practice to access more tables in 1 model, if the tables are related.


CMS - Couple of questions - El Forum - 10-25-2008

[eluser]Derek Allard[/eluser]
No, it is not bad practice to access more then 1 table in a model. Models are meant to basically hold your database queries, and if those span more then 1 table, then that's fine.