What is the problem with this following code?
class EMAIL_BODY{
public $REGISTRATION = <<<EOF
<html>
<head>
</head>
<body style='font-family: helvetica;'>
Welcome <b>#{FIRST}</b>, <br/> You have successfully created your account.
However, there is one more step that you need to take to verify your account.
Please click the below given link to activate your account.
开发者_如何学C Unless you do that your account won\'t get activated. <br/>
<a> #{LINK} </a>
</body>
</html>
EOF;
}
You must put the closing delimiter of your heredoc EOF;
right at the start of the line:
It is very important to note that the line with the closing identifier must contain no other characters, except possibly a semicolon (
;
). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon.
So:
class EMAIL_BODY{
public $REGISTRATION = <<<EOF
…
EOF;
}
精彩评论