My favorites | Sign in
Project Logo
                
Search
for
Updated Aug 18, 2007 by janko.itm
Labels: Featured, Phase-Implementation
WebShortSamples  

#short samples of Web class

Web

Web class is very simple. But it makes my code shorter and more beautiful to a very noticeable extent.

Get

The 85% of for what I use Web is this..

$page = Web::GETi('page');

This return me $GET'page' if it is set otherwise 0. the i means integer and is often used as most that you pass around are table id-s which are integers. I used to have code full of isset-s and if-s before.

//we can define a default value if the value isn't set (the default default is 0)
$page = Web::GETi('page', 1);

//without the i we get a usual string variant
$file = Web::GET('file');

//we have a default here to (the default default is '')
$file = Web::GET('file', 'index');

Other

Web class has some other function. I will describe them later.


Sign in to add a comment
Hosted by Google Code