|
|
Posted by Nel on 06/10/56 11:20
"eric rudolph" <news@digitalmediaman.com> wrote in message
news:BcudnSzj7eAdJ1XfRVn-rg@comcast.com...
> 1. I'm designing a PHP-based page that has a lot of design stuff in it.
> It's very tough to mix the HTML and PHP and have it be readable. The site
> isn't overall so complicated, there's just a lot of graphics. Is there
> some commercial way to design the page in a design program, then to use
> the designed page as a skeleton, or "template" or "fill in" page as a
> pre-cursor for a real HTML page? For instance, I could replace the
> designed graphic with a different graphic at runtime, or could switch off
> the href hyperlinks to a different place. This would be really cool, and I
> wouldn't be so hampered in my code.
>
> 2. What PHP editors exist out there which will do "intellisense" parameter
> fill-ins? I'm aware of DreamWeaver, but it's got it's minuses. Any other
> apps I should try out?
>
> thanks
>
Create your own template system - easy to do and you have complete control
over it.
1. Create a stylish looking page in the designer of your choice. Replace
key parts of the page with template tags (i.e. {pagetext} or {mainmenu}). -
Save as template.htm
2. Define your tags (i.e. Get $pagetext from a database, include a file that
defines $mainmenu)
3. Read the template.htm into a string called $output and replace all the
template tags with the string values you have defined. (I have show a simple
script to do this below)
4. Output the final version (echo $output;)
That's it!
Nel
Replace script...
$pat = array("/{{pagetext}}/s",
"/{pagetitle}/s",
"/{mainmenu}/s",
"/{submenu}/s"
);
$rep = array("$pagetext",
"$pagetitle",
"$mainmenu",
$submenu
);
// replace all occurences of search patterns with according replacements
$output = preg_replace($pat, $rep, $output);
Navigation:
[Reply to this message]
|