Welcome Guest, Not a member yet? Register   Sign In
Modules ? Yes or no.
#1

[eluser]Bl4ckB1rD[/eluser]
I'm still a beginner with this framework and i haven't got the ideology of creating webpages with it yet, that's why i'd like to hear your point of view.

I'm making web browser based mass multiplayer game, and in begining you'll have:

Login / Registration,

When you registered or logged in,
you come to Control panel.

There you have options:

Profile,
Character,
Map,
Tavern,
etc...

And the way i'm coding this is now like this: i made first controller called Game that actually consists of 2 models, login_model and login_registration. In those models i perform SQL statements, verify data etc... and in controler game i just send requests to these models and it's functions.

For all other things like profile, character, map, tavern i made it's own controller. Separated from this game, to isolate each problem on it's own, and each has his own model that performs SQL statements there, so in controllers i have as little code as possible.

I was reading about modules in CI... but what i understand, modules are actually models and controllers isolated from each other... and that's much what i'm doing here... So tell me, is this wrong approach to it or it's good way to continue. Or better... would i gain something by rewriting it to "modules" instead of having controller for each of them (profile, character, map, tavern...) ?

Also i'm using sql based sessions provided by CI. Are they secure enough or no? I have read that basic session is only cookie based, but to verify data of cookie, not to be changed, you have to enable SQL storing in ci_sessions, which i already did. So i hope this is secured well enough or should i be thinking of some other way of doing sessions?

Thanks in advance for the info.
#2

[eluser]InsiteFX[/eluser]
If you are reusing models etc, just create a MY_Controller and then extend it to your other Controllers...

Enjoy
InsiteFX
#3

[eluser]Bl4ckB1rD[/eluser]
Actually i dont need them reused. i was just wondering what's this module thing all about in CI, but i guess noone can actually explain what the difference / advantage of using it is. I was just asking for opinion if the concept of building such application is good, or even better, get suggestions how should i write my application in general, to make it as easy in future as possible. The main reason why i'm asking this is cuz i downloaded some CMS portals made in CI, and i just saw modules there, there was no controllers, models... and i was like :ohh: what the heck, why is it all in modules and what benefit do they get out of it to make it like that... either way thank you very much for your reply. If anyone else has something to comment here it would be really nice.
#4

[eluser]InsiteFX[/eluser]
Models handle all of you database and business logic so you build a model for accessing the tables and records in your application. they also allow for reuse so that you do not have to write that code again


Enjoy
InsiteFX
#5

[eluser]Bl4ckB1rD[/eluser]
Thank you very much for explaining it. And another quick question... can functions of model be executed through url, like controller's functions can? I'm just wondering since that would be a security issue of my application and i should make them all function _myfunction instead of without "_".
#6

[eluser]jedd[/eluser]
[quote author="Bl4ckB1rD" date="1257051373"]Thank you very much for explaining it. And another quick question... can functions of model be executed through url
[/quote]

No, they can't. Sleep easy.

Modules probably come into their own once you're writing a decent-sized system. I suspect that it's a case of if you have to ask whether or not you should be using modules, then you probably shouldn't (yet).

Check out wiredesignz's [url="http://codeigniter.com/wiki/Modular_Extensions_-_HMVC"]HMVC[/url] in the wiki.

For an excellent insight into a system built using this, look at Phil's [url="http://github.com/philsturgeon/pyrocms"]PyroCMS[/url].




Theme © iAndrew 2016 - Forum software by © MyBB