Guess Media: Internet & Web — Media & Development Studio

Tuesday November 18th, 2008

[ Home ]—[ About | Contact | Press | Login | Help ]—[ Research | Development | Services | Portfolio ]—[ Kids | Fun | MySpace | Scratch | Tech | NMOX ]
GuessMedia.com > Services > Defaults

Guess Media Services > Defaults

When you are creating code that requires certain elements, such as a CSS file, its nice to have a default set prior to runtime. For example, lets say you are creating an XHTML page with the following simplified PHP code:


class CustomXHTML {

var $elements;

function CustomXHTML(){

$this->elements['css'] = "http://guessmedia.com/services/css/default.php";

}

function setCSS($path){

$this->elements['css'] = $path;

}

}


See how there's still a CSS file linked in before it is set on purpose, even if the programmer forgets to call $myCustomXHTML->setCSS()? That's the purpose in having a default set by code.

The reason to have this default linked to a central source, such as the Guess Media Defaults Services, is that the code you write then becomes portable to any site without making changes or having to copy files between sites.

Our Defaults services use the correct headers to output accurate content types.

Feel free to link these in to your work! We make no guarantee of availability on our free services, so contact us if you are using this for mission-critical projects.

Get Firefox :: Get Thunderbird :: Get Flash :: Get Adobe Reader :: Get Quicktime :: Get Java :: Get Limewire :: Get Real :: Get Paid :: Get Services ]
©2005–2008 David, Aeysha, & Tegan :: Some Rights Reserved :: Powered by PacketCafe :: Disclaimers :: Privacy :: Site Map :: Site Search :: Κολοφων