Method Chaining in PHP

Method Chaining is a technique where different methods are chained together into single instruction. For example, $dao->execute()->prepare($var) ; The above method of chaining will work as long as the functions called will return an object to chain on. For example, object->function_3(); (object-function_2())->function_3();      // function_3 still gets an obj ( ( object->function_1() )->function_2() )->function_3();   // finally The class definition for this is: <?php /** method chaining class */ class myclass{ public $var ; public function_1(){ echo __FUNCTION__"\n" ; return $this; }      public function_2(){ echo __FUNCTION__"\n" ; return $this; }      public function_3(){ echo __FUNCTION__"\n" ; return $this; } } All the function above returns $this and can be chained.…
Read More

Bootstrap CSS3 Class LIst

Basic Bootstrap Classes .container sets fixed width to an element (which changes depending on a screen size to other fixed values, so it's still responsive) on all screen sizes except xs - on xs, the width is calculated automatically (this behaviour can be changed) a fixed width responsive website should be wrapped in .container (or just the content without menu, whatever - it's up to you) .container can't be nested! .container-fluid sets 100% width, margin-left and margin-right: auto, padding-left and padding-right: 15px a full screen website should be wrapped in .container-fluid .container-fluid can't be nested! .row creates horizontal groups of columns (which usually have width classes, see below) must be…
Read More

How to disable php session() cookie ?

Why would you want to do that? Is it because you are executing an application in php and its not working. Sometimes you need to refresh the page twice to get it work, or maybe its only working once and then it would work only after executing the cookie cleaner? Solution : Add the following to your .htaccess file: SetEnv session.use_cookies='0'; Of, before you call session_start(), add the following to your php files: ini_set('session.use_cookies', '0'); To permanently disable cookies for session on the server ( not recommended !), add the following to your php.ini file : session.use_cookies = 0 Comments welcome. Regards
Read More