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

How to fetch content from Smarty Block?

 
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 -> General
View previous topic :: View next topic  
Author Message
Tipo
Smarty n00b


Joined: 19 Sep 2014
Posts: 4

PostPosted: Fri Sep 19, 2014 2:02 pm    Post subject: How to fetch content from Smarty Block? Reply with quote

Hi there,

I'm a totally Newbie with Smarty.

When I want to read the whole template file with PHP, is it possible just to say I want only get the content of one block inside that tpl-file?
Something like
$Smarty->get($blockname, $filename);

Or have I to parse the whole file and search the blocks I need to get the contents?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Sep 20, 2014 11:56 am    Post subject: Reply with quote

That is currently not possible, but I did put it on the wishlist.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Sat Sep 20, 2014 4:04 pm    Post subject: Reply with quote

What is the use case for this?
Back to top
View user's profile Send private message Visit poster's website
Tipo
Smarty n00b


Joined: 19 Sep 2014
Posts: 4

PostPosted: Sat Sep 20, 2014 11:53 pm    Post subject: Reply with quote

A Use Case is e.g. to call a preDispatcher that need some informations depending on the content from some special blocks.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Sep 30, 2014 2:15 pm    Post subject: Reply with quote

That's rather vague statement.
Will that be rendered content, or raw template code?
Can you provide an example?
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 -> General 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