...

View Full Version : Shorthand Coding?



LSCare
11-17-2011, 04:40 PM
$this->current_page = 1;
$this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp;

Hello,

Does anyone know a name for this style of shorthand code. E.g. the use of the arrows -> and the shorthand IF.

Also does anyone know of any good references or tutorials for using this shorthand.

Ahlahn
11-17-2011, 04:45 PM
The shorthand IF is called a ternary operator. The "->" that you see is not what one would call a shorthand. It's a reference to the attributes of the class that the variables/methods are in.

myfayt
11-17-2011, 05:05 PM
It's PHP OOP. You can learn it here.

http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum