CodeIgniter Forums
Parser and if statement - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Parser and if statement (/showthread.php?tid=64972)

Pages: 1 2


RE: Parser and if statement - ivantcholakov - 04-15-2016

I've got integrations of both of Lex and Twig, but in the end I would propose Twig, its output escaping feature is very well thought.


RE: Parser and if statement - albertleao - 04-15-2016

(04-15-2016, 10:16 AM)sasatozovic Wrote: It works without parser, but as I said I have to use parser Sad.

Beside twig, which template engine also I should consider?

I use Blade from Laravel. Very very easy to integrate into CI, up to date, and has a ton of features to help you out (Template inheritance, auto escaping...)


RE: Parser and if statement - InsiteFX - 04-15-2016

COMPER Template Parser v 3.0.1 Is still around and has been given to the community.

COMPER Template Parser v 3.0.1

Handles if else end if

etc;


RE: Parser and if statement - kilishan - 04-15-2016

I don't know exactly what your client has requested, but PHP still works inside the parser, IIRC. So you could do the if statement with straight PHP, keeping the rest of it to using the parser.


RE: Parser and if statement - sasatozovic - 04-16-2016

(04-15-2016, 07:25 PM)kilishan Wrote: I don't know exactly what your client has requested, but PHP still works inside the parser, IIRC. So you could do the if statement with straight PHP, keeping the rest of it to using the parser.

But I can't use this in view:

PHP Code:
<?php if($var==1)
{
echo 
"active";
}
esle
{
echo 
"disabled";
}
?>

I have to use without any php.


RE: Parser and if statement - sasatozovic - 04-16-2016

(04-15-2016, 06:41 PM)InsiteFX Wrote: COMPER Template Parser v 3.0.1 Is still around and has been given to the community.

COMPER Template Parser v 3.0.1

Handles if else end if

etc;

I tried this but don't know how to use if, else etc. In description is only this:

Code:
<!-- IF {day} == 1 -->
Monday
<!-- ELSEIF {day} == 2 -->
Thuesday
<!-- ELSEIF {day} == 3 -->
...
<!-- END -->


But that doesn't work cause actually is comment!?


RE: Parser and if statement - Tpojka - 04-16-2016

Have you tried with Smarty?


RE: Parser and if statement - sasatozovic - 04-16-2016

I tried but so confused, I don't know how to install. I haven't found link with full step by step, always something missing.


RE: Parser and if statement - InsiteFX - 04-16-2016

PHP is only visible in the source html not in the output of html.

So if your client views the web page there will be no PHP in it.


RE: Parser and if statement - sasatozovic - 04-16-2016

Please don't try persuade me into something else, I know why I have to do in that way and only I need solution. I rather choose easier way but in this case I can't.