Catchable fatal error: Object of class Template_Standard could not be converted to string
<p>So, I'm having this weird error: <code>Catchable fatal error: Object of class Template_Standard could not be converted to string in C:\wamp\www\game\template\standard\index.php on line 23</code></p>

<p>It's basicly made up of these two files:</p>

<p>template_standard.php (functions file):</p>

<pre><code>&lt;?php
if (!defined('INCLUDED')) exit;

class Template_Standard
{
    public function print_login_text ()
    {
        global $user_functions, $path;
        if ($user_functions -&gt; is_logged_in ())
        {
            return '&lt;p&gt;' . WELCOME_BACK . $_SESSION['username'] . '&lt;/p&gt;';
        }
        else
        {
            return '&lt;div id="login_form"&gt;
                &lt;form action="' . $path . 'login" method="post"&gt;
                    &lt;p&gt;
                        &lt;input type="text" name="name"/&gt; ' . NAME . '&lt;br/&gt;
                        &lt;input type="password" name="pass"/&gt; ' . PASSWORD . '
                    &lt;/p&gt;
                    &lt;p&gt;&lt;input type="submit" value="' . LOG_IN . '" class="button"/&gt;&lt;/p&gt;
                    &lt;p&gt;&lt;a href="' . $path . 'register" onclick="get_register();return false"&gt;' . REGISTER . '&lt;/a&gt;&lt;/p&gt;
                &lt;/form&gt;
            &lt;/div&gt;';
        }
    }

    public function print_menu ()
    {
        global $path;
        $html = '&lt;ul id="menu"&gt;';
        $html .= '&lt;li&gt;&lt;a href="' . $path . '"&gt;&lt;img src="' . $path . 'media/menu/home.png" width="100" height="35"/&gt;&lt;/a&gt;&lt;/li&gt;';
        $html .= '&lt;li&gt;&lt;a href="' . $path . 'register"&gt;&lt;img src="' . $path . 'media/menu/register.png" width="100" height="35"/&gt;&lt;/a&gt;&lt;/li&gt;';
        $html .= '&lt;/ul&gt;';
        return $html;
    }
}
?&gt;
</code></pre>

<p>And the template file:</p>

<pre><code>&lt;?php
if (!defined('INCLUDED')) exit;

require '././functions/template_standard.php';
$template = new Template_Standard();

$register_form = '&lt;form action="' . $path . 'register" method="post"&gt;\\
    &lt;p&gt;\\
        &lt;input type="text" name="name"/&gt; ' . NAME . '&lt;br/&gt;\\
        &lt;input type="password" name="pass"/&gt; ' . PASSWORD . '&lt;br/&gt;\\
        &lt;input type="password" name="pass2"/&gt; ' . PASSWORD_AGAIN . '&lt;br/&gt;\\
        &lt;input type="text" name="email"/&gt; ' . EMAIL . '&lt;br/&gt;\\
    &lt;/p&gt;\\
    &lt;p&gt;&lt;input type="submit" value="' . REGISTER . '" class="button"/&gt;&lt;/p&gt;\\
&lt;/form&gt;';
$head .= &lt;&lt;&lt;HTML
&lt;link href="{$path}template/$template/style.css" rel="stylesheet" type="text/css"&gt;&lt;/link&gt;
&lt;!--[if lt IE 9]&gt;&lt;style type="text/css"&gt;#content{border:1px solid #333;}&lt;/style&gt;&lt;![endif]--&gt;
&lt;script type="text/javascript"&gt;
function get_register ()
{
    var speed = 'fast';
    var html = '$register_form'; // Error here
    $('#login_form').fadeOut(speed, function(){
        $('#login_form').html(html).fadeIn(speed);
    });
    return false;
}

$(document).ready(function(){
    if (screen.height &lt; 768) {
        $('#footer').hide();
    } // Fourth error, and so on
}); // Third error here
&lt;/script&gt; // If I remove the place with the first error, the second is here ...
HTML;
$body_start .= '&lt;div id="content"&gt;&lt;a href="' . $path . '"&gt;&lt;div id="header"&gt;&lt;img src="' . $path . 'media/header/logo.jpg" width="600" height="150"/&gt;&lt;/div&gt;&lt;/a&gt;&lt;div id="menu-container"&gt;' . $template -&gt; print_menu () . '&lt;/div&gt;&lt;br style="clea:left"/&gt;&lt;div id="content-left"&gt;';
$body_end .= '&lt;/div&gt;&lt;div id="content-right"&gt;' . $template -&gt; print_login_text() . '&lt;/div&gt;&lt;/div&gt;&lt;div id="footer"&gt;&lt;div style="float:right;text-align:right"&gt;Lorem ipsum ...&lt;/div&gt;Copyright &amp;copy; 2012 Jacob&lt;br/&gt;All rights reserved&lt;/div&gt;';
?&gt;
</code></pre>

<p>The thing is, if I remove the line with the error, it'll just throw an error at another line inside the HTML things. Only way to resolve it is to remove everything in it.
Also, it works good if I have the functions directly in the template file.</p>
