Welcome Guest, Not a member yet? Register   Sign In
template library sending vars to view
#1

[eluser]neosable[/eluser]
I have this:

Code:
$data['hello'] = 'hello';
$this->template->write_view('content', 'user/register', $data);
$this->template->render();

and in the view:

Code:
<h2> New user sign up &lt;? echo $hello ?&gt;</h2>

but there is no displaying hello in the view, what can be the problem ?
#2

[eluser]TheFuzzy0ne[/eluser]
Try
Code:
&lt;?php echo $hello; ?&gt;

instead. It may be that short tags are not supported by your server.
#3

[eluser]neosable[/eluser]
lol that was so simple that never thought about it

thanks
#4

[eluser]TheFuzzy0ne[/eluser]
For servers that run PHP 4, CodeIgniter can parse short tags for you at the expense of a little extra overhead. If you want this functionality, change:
Code:
$config['rewrite_short_tags'] = FALSE;

# To...

$config['rewrite_short_tags'] = TRUE;
at the bottom of your config.php.




Theme © iAndrew 2016 - Forum software by © MyBB