• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using parser->parse();

#1
[eluser]staJr[/eluser]
I all,
I'm new to CI and I'm really happy !!

Wondering something :
I'm using the parser and in a view file I have something like : {foo} <p>{foofoo}</p> {/foo}
The parser is working perfectyl and it output in the view file the correct data.

But !

When I take a look in my source code (using chrome) I see the <p>...</p> but foreach, after the closing tag, I have a withespace then a new line, then the next <p>...</p>, then a withespace, then a new line ...

Like :

Code:
<p>...</p>whitespace (bad)
new line (bad)
Code:
<p>...</p>whitespace (bad)

Any idea ?

Thanxs.

J.

#2
[eluser]Eric Barnes[/eluser]
Why does the whitespace matter?

#3
[eluser]staJr[/eluser]
Thanks Eric for you assistance !

My probleme is not about whitespaces (it's not a big deal) but more about the "\n" new line inserted in each loop of my foreach.
As I mentionned this is my pb :

Code:
{foo_foreach}
  &lt;link rel="stylesheet" type="text/css" media="screen" href="{foo_url}" /&gt;
{/foo_foreach}

Will output :

Code:
&lt;link rel="stylesheet" type="text/css" media="screen" href="http://www.exemple.com/css/css.css" /&gt;whitespace
--&gt; new line <--
&lt;link rel="stylesheet" type="text/css" media="screen" href="http://www.exemple.com/css/css.css" /&gt;whitespace
--&gt; new line <--
&lt;link rel="stylesheet" type="text/css" media="screen" href="http://www.exemple.com/css/css.css" /&gt;whitespace

What if I don't want those new lines for each loop ?

The only way I found for not having those new lines is TO USE "Alternative Control Structures". It works and I don't have new lines.

So, as I want to use the parser and the {tags}, I'm wondering if there is something I'm missing to not have the "new lines".

Thanks.

Jean.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.