Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Suggestion for the 'indent' modifier

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
roel_v
Smarty Rookie


Joined: 17 Nov 2010
Posts: 11

PostPosted: Fri Dec 03, 2010 6:50 pm    Post subject: Suggestion for the 'indent' modifier Reply with quote

(I posted this as a comment to the docs too, but I'm not sure if that's the correct place...)


I would like to suggest to add a third parameter to 'indent' to specify whether or not to indent the first line of the block being indented. Consider:

Quote:

{$some_text|indent}


where $some_text = "line1\nline2\nline3".

The result is

Code:

        line1
    line2
    line3


but what you most likely want is for all three lines to be aligned.

A third boolean parameter, 'indent_first' with a default to 'true' for backward compatibility, would fix this.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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