Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2011
    Location
    Swindon, England
    Posts
    124
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Shorthand Coding?

    $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.

  • #2
    New Coder
    Join Date
    Sep 2010
    Location
    The Twilight Zone
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    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.

  • #3
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,408
    Thanks
    68
    Thanked 102 Times in 101 Posts
    It's PHP OOP. You can learn it here.

    http://www.phpfreaks.com/tutorial/oo...in-full-effect
    Been a sign maker for 7 years. My business:
    American Made Signs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •