Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Why some modifiers syntax is not working?

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
Adhi Arunkumar
Smarty n00b


Joined: 08 Jun 2018
Posts: 1

PostPosted: Fri Jun 08, 2018 4:10 am    Post subject: Why some modifiers syntax is not working? Reply with quote

Below is the example referred from "chapter 5-variable modifiers" in that "indent" is one of the syntax.
what is my question is! I copied the exact code and paste it and runned it. but i doesn't output me which was been given.

PHP code:
$smarty->assign('doorDie',
'NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.'
);

tpl:
{$articleTitle}

{$articleTitle|indent}

{$articleTitle|indent:10}

{$articleTitle|indent:1:"\t"}


Output to be displayed:

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.


What i get displayed!

NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.


So, please help. I am using smarty version 3.1.30.

Thanks is advance. Smile Smile Smile [/b]
Back to top
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 195
Location: West Coast

PostPosted: Fri Jun 08, 2018 6:06 pm    Post subject: Reply with quote

What are you using to view the output?

If a text editor, there should be white sapce and line endings.

If a web browser, leading white space and most line endings are removed. Elsewhere, sequences of white space and line endings are collapsed into a single space. Have your browser show you the source content. The source view should display with all white space formatting applied.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP