A function like 'Fetch' but only grabs info inside a certain tag.
| From: | WiL Laxa | Date: | Tue, 26 Feb 2002 01:20:25 +0000 |
| Subject: | A function like 'Fetch' but only grabs info inside a certain tag. | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2847@lists.php.net to get a copy of this message | ||
Question:
I have a template like this: search.htm
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
{capture name=body}
<FORM NAME="form1" METHOD="post" ACTION="">
<INPUT TYPE="text" NAME="textfield" VALUE="{$Name}">
<INPUT TYPE="submit" NAME="Submit" VALUE="Search">
</FORM>
{/capture}
</BODY>
</HTML>
Can I caputure "body" on my script
Script:
<?
$smarty = new Smarty;
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill");
$body = $smarty->fetch('search.htm');
?>
But i don't want to get the whole template... just the {capture} 'body'
part. And use that to place on my site template.
<?
$smarty->clear_all_assign();
$smarty->assign("Body",$body);
$smarty->display('template.htm');
?>
Is it possible to do that?
WiL
---
You are currently subscribed to smarty as: wlaxa@blendermedia.com
To unsubscribe send a blank email to $subst('Email.Unsub')
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/