|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
l810c Smarty Rookie
Joined: 04 Feb 2006 Posts: 6
|
Posted: Sat Feb 04, 2006 4:46 am Post subject: OOP/Smarty design suggestions |
|
|
I'm an intermediate PHP developer and have just recently started with OOP and brand new at Smarty.
I'm developing a house rental application.
Say I have 3 tables:
landlords
renters
properties
I jumped right in and was fairly quickly able to modify the Guestbook application to Landlords. Added a delete function and now have a nice backend maintenace page for landlords.
I was thinking that I would create completely separate classes for renters and properties, but then I started getting a bit confused.
All of the information in the guestbook_setup.php(no landlord_setup.php) would be redundant.
Should I have a master RENTAL class and access all the tables from it? Or should I setup classes for each table?
This is where all simple tutorials I have found are lacking. I need a simple multi-table application framework.
Any suggestions would be great. Code examples or links would be excellent. |
|
Back to top |
|
demental Smarty Rookie
Joined: 11 Jan 2006 Posts: 20 Location: Lost in the French deeeeep countryside
|
Posted: Sat Feb 04, 2006 9:59 am Post subject: |
|
|
Your description is quite vague, anyway I would advise you to make kind of an abstract class to handle common tasks, then make two subclasses for each guestbook. If you want some efficient database handling I suggest you to have a look at the killer PEAR extension DB_DataObject.
http://pear.php.net/package/DB_DataObject
And some ways to use Smarty and PEAR extensions together here :
http://demental.info/blog/ |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|