Hi All
I need to build a site that will have a database with some php code handling all the work.
The layout will be based on a design of the companys print catalog.
And the Print design isnt ready. So I need to start working on the php code already.
I was thinking of whipping together a site in dreamweaver with some tables etc just to place all the elements and links and so on, and then have someone write the php code I need.I would then test the system and later as the design is ready, layout the actual site with css, then have the coder attach the code tto the new site.
Can anyone estimate is that a method that will end up wasting time and effort as the eventual site will be done in css with no tables if possible?
I mean I understand that some php code will surely have to look different but how big will the difference be, wil it be worth it?
I would appreciate any advice.
Thanks
Sami
PHP & CSS Vs. PHP + tables
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Write your PHP as though there were no markup involved. Set vars, etc, but don't code a thing that renders yet.
Then write your markup as though it were static. After both are done, put them together. Code first, then markup, using the markup to show what your code has done by strategically placed <?php echo $thesevars; ?> throughout as needed.
Then write your markup as though it were static. After both are done, put them together. Code first, then markup, using the markup to show what your code has done by strategically placed <?php echo $thesevars; ?> throughout as needed.
I agree with Everah. Let the backend spit out only the necessary markup. If any. Then in the templates you only have to include the vars or loop through a resultset and surround it with markup.
If in some cases you'd want to let the PHP produce markup, I would keep it to a minimum and definitely not use tables. Tables are rigid and cannot be changed in the design. On the other side, a simple <ul> or some divs can be designed in any way with the css.
For example if you'd want to show a list of the main categories on your site. Let the PHP produce a <ul class="catlist"> and you or the designer can design it any way you want.
If in some cases you'd want to let the PHP produce markup, I would keep it to a minimum and definitely not use tables. Tables are rigid and cannot be changed in the design. On the other side, a simple <ul> or some divs can be designed in any way with the css.
For example if you'd want to show a list of the main categories on your site. Let the PHP produce a <ul class="catlist"> and you or the designer can design it any way you want.