开发者

Multi line variable not getting created

开发者 https://www.devze.com 2023-01-24 20:10 出处:网络
What is the problem with this following code? class EMAIL_BODY{ public $REGISTRATION = <<<EOF

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号