Welcome Guest, Not a member yet? Register   Sign In
Code Iginter Core subclassing
#1

[eluser]Daniel Peraza[/eluser]
Hi there!.

I am not a guru on PHP but I recently discovered CI and it really surprised me because of its ease of use. Now I'm using CI to develop a simple application for a client which will need session handling and an authentication mechanism, as well as some database operations (as most of the PHP applications nowadays).

They way I'm planning to do this is, first, customizing CI installation in order to separate front-end from back-end applications (which I have already done), and then, using a kind of proxy controller in the back-end, let's say 'Admin', through all the requests will pass. Before redirecting the request to the proper controller, it will check if the current user is logged in, and if not, it will redirect to the proper authentication form. I think this could be implemented in the Admin's constructor, but then I will need a way to make the rest of my constructors inherit from it, which is the problem I face right now. How should be the best way to do this?.

On the other hand, I'm thinking to implement a base class with generic implementations of CRUD queries, storing the DB table name on a member variable, that then all derived classes will customize to perform their tasks with the CI Active Record class. I can't implement this class as a library because CI doesn't allow me to inherit the Model class by this way. Should I use this class as a model?, How should I do this?

I'm just trying to avoid hard-coded require_once constructs, since so far as I have read the documentation available, the CI Loader class always instantiates imported classes which is not necessarily something I want to do.

Please, give me some suggestions on this issue. Thanks in advance.


Messages In This Thread
Code Iginter Core subclassing - by El Forum - 10-20-2008, 06:12 PM
Code Iginter Core subclassing - by El Forum - 10-20-2008, 08:07 PM
Code Iginter Core subclassing - by El Forum - 10-21-2008, 01:38 PM
Code Iginter Core subclassing - by El Forum - 10-21-2008, 01:45 PM
Code Iginter Core subclassing - by El Forum - 10-23-2008, 03:25 AM
Code Iginter Core subclassing - by El Forum - 10-23-2008, 01:56 PM
Code Iginter Core subclassing - by El Forum - 10-23-2008, 08:04 PM
Code Iginter Core subclassing - by El Forum - 10-24-2008, 02:01 PM
Code Iginter Core subclassing - by El Forum - 10-24-2008, 02:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB