logo       
Google Custom Search
    AddThis Social Bookmark Button

OSDir News:
05/09 Skype Gives Up Anti-GPL Appeal
From the FTW dept.: ...In the end, the court hinted twice that if it was to judge ab..
05/08 GPL vs. Skype Back In Court
From the Enforcement dept.: Tomorrow at 10:30am at the Oberlandesgericht Muenchen (h..
05/08Moz Firefox Shipped Malware Attached to Extention
From the Knowing is Better Than Not dept.: The Vietnamese language pack for Firefox ..
05/08Harvard Law votes Yes on open access
From the The Right Kind dept.: The faculty of Harvard Law School has unanimously app..
05/08FBI Withdraws Unconstitutional National Security Letter After ACLU and..
From the The Wrong Kind of Open Access dept.: The FBI has withdrawn an unconstitutio..
05/07 OpenOffice.org 3.0 Beta
From the Oh! OOo dept.: The most immediately visible change to OpenOffice.org 3.0 is..
In Association with feed.informer.com

Re: dreamweaver templates: msg#00343

Subject: Re: dreamweaver templates
It's not really PEAR, but if the template has a syntax like

 <!-- InstanceBeginEditable name="title" -->
 ...
 <!-- InstanceEndEditable -->

Then how about:

<?

$template = "template.dwt" ;
$content = array(
 "title" => "Here's my title" ,
 // etc
) ;

$find  = '/<\!-- InstanceBeginEditable name="([^"]+)" -->.*<\!-- 
InstanceEndEditable -->/iseU' ;
$replace = '$content["\\1"]' ;

$in   = join('', file($template)) ;
$out  = preg_replace($find, $replace, $in) ;

print $out ;

?>

Nick

----- Original Message ----- 
From: "Paul Wolstenholme" <wolstena@xxxxxx>
To: "Ryan King" <RyanSKing@xxxxxxx>
Cc: <pear-general@xxxxxxxxxxxxx>
Sent: Wednesday, November 19, 2003 11:42 PM
Subject: Re: [PEAR] dreamweaver templates


> As far as I know, Dreamweaver templates are just regular html files
> with special html comments that are used by Dreamweaver to determine
> what areas are editable. PHP will more than likely just ignore these
> comments.
> /Paul
>
> On 19-Nov-03, at 3:12 PM, Ryan King wrote:
>
> > On Wednesday, November 19, 2003, at 02:56  PM, Paul M Jones wrote:
> >
> >> On Nov 19, 2003, at 2:02 PM, Ryan King wrote:
> >>
> >>> Does anyone know of a php package that handles Dreamweaver
> >>> templates?  I'm working on a new project in which that functionality
> >>> would be very useful.
> >>
> >> Whe you say "handles" Dreamweaver templates, what exactly do you
> >> mean?  (Some of us are still hand-coding vampires and shrink from the
> >> bright light of WYSIWYG tools.  ;-)
> >
> > To clarify some more... instead of using Smarty or php (as savant
> > apparently does) for markup, I want to use the Dreamweaver style
> > markup, have it parsed and used by php scripts.
> >
> > ryan
> >
> > -------------------
> > http://homepage.mac.com/ryansking/
> >
> > -- 
> > PEAR General Mailing List (http://pear.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> -- 
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>