Welcome Guest, Not a member yet? Register   Sign In
Parser and if statement
#11

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.
Reply
#12

(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...)
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#13

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;
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#14

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.
Reply
#15

(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.
Reply
#16

(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!?
Reply
#17

Have you tried with Smarty?
Reply
#18

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.
Reply
#19

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#20

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB