forcer Posted July 11, 2008 Share Posted July 11, 2008 i'm having a go at creating my own news system and i hate editing html within a echo ""; element i've got forms and divs elements that make up the html pages but are outputted with echo. how would i implement a skinning or template system so all the forms and html are seperate pages... Link to comment https://forums.phpfreaks.com/topic/114266-templates-rather-than-echo/ Share on other sites More sharing options...
mbeals Posted July 11, 2008 Share Posted July 11, 2008 may or may not help, but you know you can mix php and html right? This is valid code: <?php $test = 1; $test2 = 2; $test3 = array("one" => 1, "two"=> 2, "three"=> 3); ?> <table> <tr> <td><?=$test?></td> <td><?=$test2?></td> </tr> <? foreach($test3 as $key => $value){ ?> <tr> <td><?=$key?></td> <td><?=$value?></td> </tr> <? }?> </table> Not a single echo statement and my html is basically how it would be without the php at all. Link to comment https://forums.phpfreaks.com/topic/114266-templates-rather-than-echo/#findComment-587560 Share on other sites More sharing options...
MatthewJ Posted July 11, 2008 Share Posted July 11, 2008 short tags are the devils playground Or something like that... Link to comment https://forums.phpfreaks.com/topic/114266-templates-rather-than-echo/#findComment-587565 Share on other sites More sharing options...
waynew Posted July 11, 2008 Share Posted July 11, 2008 Use smarty. Link to comment https://forums.phpfreaks.com/topic/114266-templates-rather-than-echo/#findComment-587577 Share on other sites More sharing options...
forcer Posted July 14, 2008 Author Share Posted July 14, 2008 thanks i'll check it out... any other suggestions? Link to comment https://forums.phpfreaks.com/topic/114266-templates-rather-than-echo/#findComment-589510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.