You are here: Re: Tough designing and PHPing at the same time « PHP Programming Language « IT news, forums, messages
Re: Tough designing and PHPing at the same time

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация