Skip to main content

Posts

Showing posts from October, 2016

CakePHP Interview Question and Answer

CakePHP Interview Question and Answer What is the first file that gets loaded when you run a application using cakephp? Answer: bootstrap.php     You can be changed it either through index.php , or through .htaccess     How to change via webroot > index.php         if (!defined('CAKE_CORE_INCLUDE_PATH')) {         if (function_exists('ini_set')) {             ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));         }         if (!include('Cake' . DS . 'bootstrap.php')) { // Change bootstrap.php file to any file name             $failed = true;         }     } else {         if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {             $failed = true;         }     }         How to change through .htaccess         DirectoryIndex test.php     Which Function Is Executed Before Every Action In The Controller? Answer: Contro

Javascript Local Storage

Javascript Local Storage LocalStorage is used to stored web application data within the user's browser. LocalStorage is only store strings in the different keys How to check user's browser support? if (typeof(Storage) !== "undefined") {     // Code for localStorage/sessionStorage. } else {     // Sorry! No Web Storage support.. } How to Set Values in localStorage localStorage. setItem ('favoriteflavor','vanilla'); How to Access localStorage variable If you read out the favoriteflavor key, you will get back “vanilla”: var taste = localStorage. getItem ('favoriteflavor'); How to remove Elements from localStorage localStorage. removeItem ('favoriteflavor'); var taste = localStorage.getItem('favoriteflavor'); How to Store Array in LocalStorage localStorage is for key : value pairs, so what you'd probably want to do is JSON.stringify the array and store the string in the mycars key and then you can pul