eric rudolph wrote:
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 "intellisen se"
parameter fill-ins? I'm aware of DreamWeaver, but it's got it's
minuses. Any other apps I should try out?
thanks
This is how I do it:
1. design a page in Photoshop or something like that
2. spend some time deciding how to transform images into HMTL, what is going
to be text, what images will stay as images, etc.... This is the CRUCIAL
step.
3. Create template in HTML, and validate it using xhtml or html strict (the
stricter the better).
4. take out common elements from HTML and put them into a separate file as
functions. I call this file _snippets.php and it may include functions like
function ender ($note) {
$v = '</div></div>.<p id="finalnote" >
'.$note.'
</p>';
return $v;
}
I usually have three functions in the _snippets.php file
a. starter with all the header info
b. ender with all the standard html at the bottom of the page
c. menuer, which contains a menu. I usually use the replace function to
highlight the current item in the menu by passing the file name to the
menuer function.
5. create individual php pages that look like this:
<?php
include_once("_ snippets.php");
//connect to database, etc...
//lots of php
//---------------------------------
echo starter($title, $subtitle, $icon, $color);
echo menuer($filenam e, $submenu);
?>
<!-- Content for the individual page here -->
<?php
echo ender($note);
?>
In that way I can
a. change the whole site at once in the _snippets.php file.
b. easily edit the content of the individual php pages without having any
structural elements in the way
c. All javascript is in one or more javascript files
d. All styles are in a stylesheet.
Personally, I find this a really powerful way to create a website and even
though I only use Notepad2 (similar to Notepad, but with a few powerful
functions and colour coding). I dont loose track of things, because I
minimize the amount of coding to the bare minimum and I know exactly where
is what because I created it and not some program that often adds lots
extras.
- Nicolaas