Jump to content

echo and <font style> ---does this look correct?


meltingpoint

Recommended Posts

It looks ok, but i would never do it this way. I like to keep my css seperated instead of inline style.

Instead of this you could make an easy html element with the class report. In Css you make a .report{}.

And in php you just echo an html element with that class. much cleaner and easier to fix.

Thanks fortnox-  I have done the CSS class before and you're right- I probably should continue to do it that way.  However- with the mixing of text and $variables I wanted to test and inline method. 

 

I was not sure of using the {} around the variable to isolate it rather than using a bunch of " " and having to escape them.

 

 

 

I was not sure of using the {} around the variable to isolate it rather than using a bunch of " " and having to escape them.

{} is pretty nice to use, even if it's not needed just to make it easier to read. If you just start every project with a standard css folder a JS folder a functions folder etc you will will work much faster.

 

Also this way you can make it much more dynamic. you could maybe make 3 reportclasses with green orange and red.

All you need to do Is fetch reports, with there classnumber and put classnumber in the html element.

like:

 

<echo "<p class="{$color_class}">Report: {$report_number}<br />Date of Incident: {$date}</p>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.