Welcome Guest, Not a member yet? Register   Sign In
Extending the Controller, Twice
#12

[eluser]AlexJ[/eluser]
Its used to run a CMS, this CMS has some default functionality and some functionality that can be extended by using a modular approach, in my V_Module I would define some basic functions:

- index()
- create()
- edit($primary_key)
- delete($primary_key)

In my V_Controller is would define these 2 functions:
- header()
- footer()

I need these in the basic controllers, but also in the V_Module.

These functions are the complete CMS, to edit rows, create them and delete them, basicly the abstract layer for all the modules.

But there are some modules that need a different approach, they dont use the default layout for some reason (to implement barcodes). I can just define a controller for that module, and overwrite the default index() function.

Writing a new module is as easy as 1,2:

1. Create new controller that uses V_Module
2. Create a new model that uses my own V_Model and pass the table name and primary key to the constructor


Messages In This Thread
Extending the Controller, Twice - by El Forum - 10-19-2009, 10:30 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 10:50 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 10:56 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:16 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:25 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:29 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:37 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:41 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:43 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 11:51 AM
Extending the Controller, Twice - by El Forum - 10-19-2009, 12:11 PM
Extending the Controller, Twice - by El Forum - 10-19-2009, 12:24 PM
Extending the Controller, Twice - by El Forum - 10-19-2009, 04:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB