method for creating PHP templates (ie html with variables)?
Posted
by Haroldo
on Stack Overflow
See other posts from Stack Overflow
or by Haroldo
Published on 2010-05-25T14:42:30Z
Indexed on
2010/05/25
14:51 UTC
Read the original article
Hit count: 195
php
I'm designing my html emails, these are to be a block of html containing variables that i can store in a $template variable.
My problem comes with the storing in the variable part. putting all my html into php makes it a pain in the bum to work with.
for example, the below code is fine for a simple email but once i start getting nested tables etc its going to get really confusing...
$template.= 'Welcome ' . $username . '<br /><br /><br />';
$template.= 'Thank-you for creating an account <br /><br />';
$template.= 'Please confirm your account by click the link below! <br /><br />';
$template.= '<a href="' . $sitepath . '?email=' . $email . '&conf_key=' . $key . '" style="color: #03110A;"><font size="5" font-family="Verdana, Geneva, sans-serif" color="#03110A">' . $key . '</font></a>';
$template.='</body></html>';
is there a way i can still store the html in a $var but not have to write it like this?
© Stack Overflow or respective owner