CodeIgniter Forums
Short tag does not work...?? - 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: Short tag does not work...?? (/thread-17912.html)



Short tag does not work...?? - El Forum - 04-19-2009

[eluser]Unknown[/eluser]
Hi, I am new to PHP and currently facing issues while working on my 1st PHP app.

The issue is :

<?php= form_open('expense/fix_insert');?>

would not work on my PHP view file and would not get translated to
<form method = "post" action = "http://localhost/ci/index.php/expense/fix_insert">
in the source code on the browser. I am using codeignite framework for my application and have loaded form helper in controller already.

Moreover, <?=$expenditure?> type of tag also does not work .. only when I use echo then it works..

in php.ini I have made below change:
short_open_tag = On [Portability]

please suggest.

Many Thanks,
MG



Short tag does not work...?? - El Forum - 04-19-2009

[eluser]umefarooq[/eluser]
have you restart your web server after making changes in php.ini file if not than restart it , it will work.


Short tag does not work...?? - El Forum - 04-20-2009

[eluser]slowgary[/eluser]
If you're using CodeIgniter, you don't need short tags on in order to use the alternative syntax. Read the user guide for more info... http://ellislab.com/codeigniter/user-guide/general/alternative_php.html


As for your first issue... what does the form action link to if not http://localhost/ci/index.php/expense/fix_insert?

Have you specified your base URL in the config file per CI's installation instructions?


Short tag does not work...?? - El Forum - 04-20-2009

[eluser]NogDog[/eluser]
My first suggestion would be to just not use short tags. It's a bad habit to get into since it binds any code that uses it to an environment which has short tags enabled. As far as the option to have CI process short tags even when the PHP configuration does not have it enabled, that comes at the expense of all such code be eval()'d, which will add additional processing overload and likely make debugging a bit more difficult due to any applicable errors showing up as eval() errors. Therefore my preference, at least, is to just type a few more characters and never have to worry about it again. Smile


Short tag does not work...?? - El Forum - 04-20-2009

[eluser]Dam1an[/eluser]
[quote author="NogDog" date="1240230379"]Therefore my preference, at least, is to just type a few more characters and never have to worry about it again. Smile[/quote]

Or, you could just make your IDE expand short tags to long tags

Although I personally prefer the synrax of short tags for echo's but stick to long tags for opening classes etc


Short tag does not work...?? - El Forum - 04-20-2009

[eluser]Unknown[/eluser]
thanks guys for replies... My issue is resolved.