Jump to content

Mixing PHP and HTML


pauleth

Recommended Posts

Hey folks, just looking for some suggestions and recommendations on the best way to mix PHP and HTML, while effectively keeping presentation and logic separate.  Do you tend to use more PHP tags in HTML blocks, or use PHP with echo to generate HTML output.  How about templates such as Smarty?  Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/100360-mixing-php-and-html/
Share on other sites

I normally use ECHO for short blocks (just a couple lines) and close the PHP tag for anything larger then that. It's all personal preference.

 

I have used Smarty in other 3rd party apps before and it's pretty slick. It's on my list to start using it on sites I build, as it will allow my clients to make small changes on their own without needing to know PHP.

Link to comment
https://forums.phpfreaks.com/topic/100360-mixing-php-and-html/#findComment-513174
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.