|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
Templates or Includes or ??
I'm in a volunteer group that conducts events that members of a larger group attend. Tracking attendance, confirmations, calendars, who came, who helped, what resulted from the attendance, etc would have value to us.
This is a multi-user database application that I'd like to construct on the web so that other volunteers in far-flung places (like their den?) could log in and both produce and consume data. Lot's of forms, tabular data, etc. I've put together the database and the forms, now taming this stateless machine to do what I want is getting hard. Would it be easier if I used an application framework, or just a template library, or a package that encapsulated templates and sessions (like phplib) or smarty or ?? When I see this many solutions to something like this, I worry about hopping on the wrong horse. But I don't want to spend all my time tire kicking either. Anybody have some experience with this kind of thing? |
|
#2
|
|||
|
|||
|
RE: Templates or Includes or ??
Hi,
I want to share that it's generally a good idea to keep the HTML outside of PHP. In other words, have HTML templates with embedded field/code designators that can be replaced (populated) by your PHP script. Smarty is very helpful in this regard. I recommend using Object Oriented Programming (OOP) approach using classes. Some people think that PHP is not good for OOP, however, I’ve had no problems. Each Class can have it’s own file called something like ‘class.ClassName.php’. Use configuration files, so there is little hard coding in your code. For example, have a configuration file that contains all the error messages that maybe displayed. Each error message is assigned a name and that’s what you use in your code. The value of what that name represents is saved in the configuration file. Try to make the database access more portable by using the PEAR library (http://www.pear.php.net). In the future, should you need to use your code on a different database architecture, this will make it easier. You could override PHP’s session handling using session_set_save_handler() to write sessions into a database, which might make login/logouts easier to manage across multiple pages or applications. I’m not sure if this is the kind of information you were seeking, but I hope I’ve at least given you ideas or things to think about. |
|
#3
|
|||
|
|||
|
RE: Templates or Includes or ??
The above post was from me. I was not logged-in at the time.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Templates or Includes or ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|