scrubbicus Posted December 7, 2009 Share Posted December 7, 2009 So I've finished up the basic framework and all the functionality of this application here and now I'm thinking the next step is going through the code and refining it because it was very neat at the beginning but gradually got less neat. All my other side project applications haven't really gotten to this step so I'm kind of at a loss. I don't quite know what I'm looking for, just some direction I suppose. I don't know if my overview will even help or if it makes any sense but any help is appreciated. Thanks! I'm trying to get myself acquainted to building object oriented application and I think I have the idea of how OOP is suppose to work. Anyway what I have is the main application class that handles the core of the application. Extra Classes I have other side classes like an encryption object, an object that handles POST data and SQL updates/insert queries and a class that handles sessions and the login/register/forgot password templates. All these classes are require() in through the main class constructor and initialized as a protected variable. Should I be initializing them like this? Template Views I've come to like the idea of using HTML/PHP template views for all my pages and then including them in through a function. I have a whole folder of the page templates I use and the way I use them is calling something like $application->get('template' , 'login'), that function include() the template then prints $html. Each template has PHP and HTML and is all combined into the $html variable, I find it easier to do whatever I need to do with that view if it's encompassed in a single variable. Main View I have an admin.php and public.php that just has the basic template of the website, these are just the index.php files for each of those modes. These are include() through the main class constructor. Actions I'm not sure if this is what it would be generally called but my main class constructor handles all these when they are isset(), then it goes through with calling functions to get the data put wherever it needs to be put. These are basically just any $_GET or $_POST information that the application needs to move forward. Installation The main class constructor redirects to setup if certain things aren't met. I have another class entirely for this that goes through the process and template views that are included through it. Quote Link to comment https://forums.phpfreaks.com/topic/184308-first-application-need-help-with-code-structure/ Share on other sites More sharing options...
killerb Posted December 14, 2009 Share Posted December 14, 2009 Interested to see this architecture, particularly "to get the data put wherever it needs to be put", is the code available? Quote Link to comment https://forums.phpfreaks.com/topic/184308-first-application-need-help-with-code-structure/#findComment-977344 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.