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

Kak obrabotat funktsii v parametre

 
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 -> Language: Russian
View previous topic :: View next topic  
Author Message
kazakbala
Smarty Rookie


Joined: 25 Jul 2005
Posts: 5

PostPosted: Thu Aug 19, 2010 8:57 am    Post subject: Kak obrabotat funktsii v parametre Reply with quote

kak sdelat obrabotku funktsii peredavaemih v zna4enii?
Naprimer:
$html = 'Hello world {module name="article" action="mainpage"}'

U menya est svoya functsiya kotoraya obrabativaet {module}
ona rabotaet esli ego ispolzovat v samom shablone

index.tpl

Code:
 <body>{module name="article" action="mainpage"}


A esli eto peredayotsya v zna4enii
index.tpl
Code:

<body>{$content}</body>

Code:

$tpl->assign('content','Hello world {module name="article" action="mainpage"}')

Back to top
View user's profile Send private message
alekvall
Smarty n00b


Joined: 14 Sep 2010
Posts: 1

PostPosted: Tue Sep 14, 2010 11:38 am    Post subject: Reply with quote

podderjivau, toje interesuet!
Back to top
View user's profile Send private message Visit poster's website
SiZE
Smarty Rookie


Joined: 15 Sep 2010
Posts: 13

PostPosted: Thu Sep 23, 2010 11:22 am    Post subject: Reply with quote

может попробовать обернуть строку в двойные кавычки, а функцию в ` - такой синтаксис по крайней мере подходит для вставки переменных.

{assign var="test" value="Hello `$name`!"}
Back to top
View user's profile Send private message
X-MAN
Smarty Rookie


Joined: 17 Dec 2005
Posts: 7

PostPosted: Wed Oct 06, 2010 9:46 am    Post subject: Reply with quote

Сорри за оффтоп: но может есть смысл посмотреть в сторону Smarty3?
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 -> Language: Russian 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