Porting functional code to MVC structure
Posted: Sun Jul 29, 2012 10:57 am
I am learning MVC framework(CI & YII for now)
Towards this i am trying to port an existing application which was done the functional way to MVC framework (say for example to CI)
Here's what I have thought about it:
1) For every database table I will create a fresh model class
2) then take up each php page like login.php, register.php, member.php etc and break it into two components for the view & controller.
Anything else that is important to keep in mind ?
Actually i have a gut feeling that there's more to the controller design than this.
How to decide the number of controllers required?
Towards this i am trying to port an existing application which was done the functional way to MVC framework (say for example to CI)
Here's what I have thought about it:
1) For every database table I will create a fresh model class
2) then take up each php page like login.php, register.php, member.php etc and break it into two components for the view & controller.
Anything else that is important to keep in mind ?
Actually i have a gut feeling that there's more to the controller design than this.
How to decide the number of controllers required?