Re: [SMARTY] How do I include HTML attributes in $CONTENT?
| From: | travis at dawnstar dot org | Date: | Wed, 14 Aug 2002 20:34:51 +0000 |
| Subject: | Re: [SMARTY] How do I include HTML attributes in $CONTENT? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5716@lists.php.net to get a copy of this message | ||
Maybe one of these?
(1) Use single quotes in the assign:
$smarty->assign("CONTENT", '<P CLASS="size2">Sunday, January 20,
2002</P>');
(2) Use str_replace before the assign to change " to \"
cheers,
Travis
On Wed, 14 Aug 2002, Eric C. Pollitt wrote:
> Please note that I am referring to the second to last line of code in the
> PHP Fast Template example which include attributes in quotes:
>
> <P CLASS="size2">Sunday, January 20, 2002</P>
>
> And without attribute quotes in Smarty:
>
> $smarty->assign("CONTENT", "<P CLASS=size2>Sunday, January 20,
> 2002</P>");
>
> I want to be able to get around this "problem."
>
> Thanks,
>
> Eric C. Pollitt, Founder
> 401 E. Illinois Ave.
> Peoria, IL 61603
> Global Hemp - Portal to the hemp community
> http://www.globalhemp.com/
>
> "Why of course the people don't want war ... But after all it is the leaders
> of the country who determine the policy, and it is always a simple matter to
> drag the people along, whether it is a democracy, or a fascist dictatorship,
> or a parliament, or a communist dictatorship...Voice or no voice, the people
> can always be brought to the bidding of the leaders. That is easy. All you
> have to do is to tell them they are being attacked, and denounce the
> pacifists for lack of patriotism and exposing the country to danger."
> --Hermann Goering, Nazi leader, at the Nuremberg Trials after World War II
>
> > From: "Eric C. Pollitt" <eric@globalhemp.com>
> > Date: Wed, 14 Aug 2002 15:08:10 -0500
> > To: <smarty-general@lists.php.net>
> > Subject: [SMARTY] How do I include HTML attributes in $CONTENT?
> >
> > I have previously been using PHP Fast Template for my new website and am
> > "upgrading" to Smarty and have come into a bit of a problem with HTML
> > attributes.
> >
> > In PHP Fast Template I did the following:
> >
> > ----------------------------------------------------------------------------
> >
> > <?php require('/home/globalhemp/www/templates/prepend.php'); ?>
> > <?php pageStart('Daydream believers'); ?>
> > <?php
> > $tpl->assign('DESCRIPTION', 'Rosemary shampoo, organic babyfood, hemp
> > combats... a walk down the aisle of your local supermarket reveals how
> > yesterday’s long-haired idealists have made hippies of us all. Tim
> > Adams meets the alternative millionaires who’ve changed their bank
> > balances by trying to change the world');
> > $tpl->assign('KEYWORDS', 'health-food, company, organic food, fraser,
> > health
> > food, people, business, daydream believers, shoes, rechelbacher, world,
> > sense, food, spirit, health, idea, stores, daydream, believers, work,
> > wanted, organic');
> > $tpl->assign('AUTHOR', 'Tim Adams, The Observer'); ?>
> > <P CLASS="size2">Sunday, January 20, 2002</P>
> > <?php pageFinish(); ?>
> >
> > ----------------------------------------------------------------------------
> >
> > However, in Smarty I can't as easily include unadulterated HTML code as
> > follows:
> >
> > ----------------------------------------------------------------------------
> >
> > <?php require '/home/globalhemp/www/Smarty/Smarty.class.php'; require
> > '/home/globalhemp/www/Poll/booth.php';
> > $smarty = new Smarty;
> > $smarty->compile_check = true;
> > $smarty->debugging = false;
> > $smarty->assign("TITLE", "Daydream believers");
> > $smarty->assign("DESCRIPTION", "Rosemary shampoo, organic babyfood, hemp
> > combats... a walk down the aisle of your local supermarket reveals how
> > yesterday’s long-haired idealists have made hippies of us all. Tim
> > Adams meets the alternative millionaires who’ve changed their bank
> > balances by trying to change the world");
> > $smarty->assign("KEYWORDS", "health-food, company, organic food, fraser,
> > health food, people, business, daydream believers, shoes, rechelbacher,
> > world, sense, food, spirit, health, idea, stores, daydream, believers, work,
> > wanted, organic");
> > $smarty->assign("AUTHOR", "Tim Adams, The Observer");
> > $smarty->assign("CONTENT", "<P CLASS=size2>Sunday, January 20,
> > 2002</P>");
> > $smarty->display('/home/globalhemp/www/Smarty/templates/index.tpl');
> > ?>
> >
> > ----------------------------------------------------------------------------
> >
> > So, is there a way to make this aspect of Smarty work like PHP Fast
> > Template? I understand that this is a simple example, but I have a few
> > thousand pages like this with obviously more that one like of HTML content.
> >
> > Thanks,
> >
> > Eric C. Pollitt, Founder
> > 401 E. Illinois Ave.
> > Peoria, IL 61603
> > Global Hemp - Portal to the hemp community
> > http://www.globalhemp.com/
> >
> > Create like a god. Command like a king. Work like a slave!
> > -- Constantin Brancusi
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>