CodeIgniter Forums
Automatic Short Tag and absolut path - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Automatic Short Tag and absolut path (/thread-38083.html)



Automatic Short Tag and absolut path - El Forum - 01-30-2011

[eluser]ludovic[/eluser]
Hello I test codeigniter 2.0 and it seem have a little problem with Automatic Short Tag
I've the famous eval() errors when i put rewrite_short_tags in TRUE;

It don't work with relatif path !

Exactly what I 've got:
Code:
A PHP Error was encountered
Severity: Warning
Message: include_once(templates/default/includes/footer.php) [function.include-once]: failed to open stream: No such file or directory
Filename: core/Loader.php(689) : eval()'d code
Line Number: 23

But if I put an absolute path it's work Smile

File application/config.php
Code:
$config['server_root']    = $_SERVER['DOCUMENT_ROOT']."/myproject";
$config['templates'] = $config['server_root']."/ci_2011/application/views/templates/";

File application/views/templates
Code:
include_once  $this->config->item('template').$version_css.'/includes/footer.php';

And the problem disappear if I get rid of the short tags... it's weird, no ?
Code:
$config['rewrite_short_tags'] = FALSE;



Automatic Short Tag and absolut path - El Forum - 01-30-2011

[eluser]ludovic[/eluser]
Ok I put short_open_tag in On in my php.ini file

There aren't any problem.