Blog

  • AngularJS Tutorial: Demystifying Custom Directives – Shared Tutorial

    With the rapid growth of JavaScript as a full stack language, more and more applications are utilizing frameworks that enable the web browser to handle more of the UI processing such as data binding, managing data views, transforming data and many other services. One of the most capable, extensible and popular frameworks is AngularJS, and one of the most useful components of the AngularJS framework is something called a directive. AngularJS provides many useful directives and, even more importantly, it provides a rich framework for creating custom directives.
    What is a directive? To put it simply, directives are JavaScript functions that manipulate and add behaviors to HTML DOM elements. Directives can be very simplistic or extremely complicated. Therefore, getting a solid grasp on their many options and functions that manipulate them is critical.
    In this tutorial, the four functions that execute as a directive is created and applied to the DOM will be explored and examples will be provided. This post assumes some familiarity with AngularJS and custom directives. If you’re newer to Angular, you might enjoy a tutorial on building your first AngularJS app.

    The Four Functions of the AngularJS Directive Life Cycle

    There are many options that can be configured and how those options are related to each other is important. Each directive undergoes something similar to a life cycle as AngularJS compiles and links the DOM. The directive lifecycle begins and ends within the AngularJS bootstrapping process, before the page is rendered. In a directive’s life cycle, there are four distinct functions that can execute if they are defined. Each enables the developer to control and customize the directive at different points of the life cycle.
    The four functions are: compile, controller, pre-link and post-Link.
    The compile function allows the directive to manipulate the DOM before it is compiled and linked thereby allowing it to add/remove/change directives, as well as, add/remove/change other DOM elements.
    The controller function facilitates directive communication. Sibling and child directives can request the controller of their siblings and parents to communicate information.
    The pre-link function allows for private $scope manipulation before the post-link process begins.
    The post-link method is the primary workhorse method of the directive.
    In the directive, post-compilation DOM manipulation takes place, event handlers are configured, and so are watches and other things. In the declaration of the directive, the four functions are defined like this.

    .directive("directiveName",function () {
        return {
          controller: function() {
            // controller code here...
          },
          compile: {
            // compile code here...
            return {
              pre: function() {
                // pre-link code here...
              },
              post: function() {
                // post-link code here...
              }
            };
          }
        }
      })

    Commonly, not all of the functions are needed. In most circumstances, developers will simply create acontroller and post-link function following the pattern below.

    .directive("directiveName",function () {
        return {
          controller: function() {
            // controller code here...
          },
          link: function() {
            // post-link code here...
          }
        }
      })

    In this configuration, link refers to the post-link function.
    Whether all or some of the functions are defined, their execution order is important, especially their execution relative to the rest of the AngularJS application.

    AngularJS Directive Function Execution Relative to other Directives

    Consider the following HTML snippet with the directives parentDir, childDir and grandChildDir applied to the HTML fragment.

    <div parentDir>
      <div childDir>
        <div grandChildDir>
        </div>
      </div>
    </div>

    The execution order of the functions within a directive, and relative to other directives, is as follows:

    • Compile Phase
      • Compile Function: parentDir
      • Compile Function: childDir
      • Compile Function: grandChildDir
    • Controller & Pre-Link Phase
      • Controller Function: parentDir
      • Pre-Link Function: parentDir
      • Controller Function: childDir
      • Pre-Link Function: childDir
      • Controller Function: grandChildDir
      • Pre-Link Function: grandChildDir
    • Post-Link Phase
      • Post-Link Function: grandChildDir
      • Post-Link Function: childDir
      • Post-Link Function: parentDir

    AngularJS Directive Function Explanation: Deep Dive

    The compilation phase occurs first. Essentially, the compile phase attaches event listeners to the DOM elements. For example, if a particular DOM element is bound to a $scope property, the event listener that allows it to be updated with the the value of the $scope property is applied to the DOM element. The process of compilation starts with the root DOM element from which the AngularJS application was bootstrapped and traverses down the branches of the DOM using a depth-first traversal, compiling a parent first then its children all the way down to the leaf nodes.
    Once compilation is complete, directives can no longer be added or removed from the DOM (although there is way around this by directly using the compile service. The next phase is the calling of controllers and pre-link functions for all directives. When the controller is called, the $scope is available and can be used. The$element injected into the controller contains the compiled template but does not include the transcluded child content (transcluded content is the content between the start and end HTML tags on which the directive is applied). By definition, controllers in an MVC pattern simply pass the model to the view and define functions for handling events. Therefore, the controller of a directive should not modify the DOM of the directive for two reasons: it violates the purpose of the controller, and the transcluded child content has not been added to the DOM. So what does a controller do beyond modify the $scope? The controller allows for child directives to communicate with parent directives. The controller function itself should be thought of as a controller object that will be passed into the child directive’s post-link function if the child directive requests it. Therefore, the controller is typically used to facilitate directive communication by creating an object with properties and methods that can be used by its sibling and child directives. The parent directive cannot determine whether a child directive can require its controller, so it is best to limit code in this method to functions and properties that can safely be used by child directives.
    After the controller function, the pre-link function executes. The pre-link function is mysterious to a lot of people. If you read much of the documentation on the Internet and in books, people write that this function is used only in rare circumstances and people will almost never need it. Those same explanations then fail to give an example of a situation where it could be used.
    The pre-link function is really not complicated at all. First, if you review the AngularJS source code you will find an excellent example of the pre-link function: the directive ng-init uses it. Why? It’s simply a great method to execute private code involving the $scope; code that cannot be called by sibling and child directives. Unlike the controller function, the pre-link function is not passed into directives. Therefore, it can be used to execute code that modifies the $scope of its directive. The directive ng-init does exactly this. When the pre-link function for ng-init executes, it simply executes the JavaScript passed into the directive against the directive’s $scope. The result of the execution is available through the $scope’s prototypal inheritance to child directives during their controller, pre-link and post-link function executions but without giving access to those child directives to re-execute the code in the parent’s pre-link function. Also, the directive may need to execute other code not related to the $scope that it wishes to keep private.
    Some experienced AngularJS developers would say this private code could still be placed in the controller and then not called by the child directives. That argument would hold true if the directive will only be used by the original developer who coded it but if the directive is going to be distributed and reused by other developers then encapsulating private code in the pre-link function could be very beneficial. Since developers never know how their directive will be re-used over the course of time, protecting private code from being executed by a child directive is a good approach to directive code encapsulation. I consider it to be a good practice to place directive communication public code in the controller function, and private code in the pre-link function. Like the controller, the pre-link should never do DOM manipulation nor execute a transclude function, since the content for child directives has not been linked yet.
    For each directive, its controller and pre-link function executes before the controller and pre-link function of its child directives. Once the controller and pre-link phase for all directives is complete then AngularJS begins the linking phase, and executes the post-link functions for each directive. The linking phase runs opposite to the compile, controller and pre-link execution flows by starting with the leaf DOM nodes and working its way up to the root DOM node. The post-link DOM traversal follows a mostly depth-first path. As each child directive is linked, its post-link function is executed.
    The post-link function is the function most commonly implemented in custom AngularJS directives. In this function, almost anything reasonable can be done. The DOM can be manipulated (for itself and child elements only), the $scope is available, the controller object for parent directives can be used, transclude functions can be run, etc. However, there are a few limitations. New directives cannot be added to the DOM because they will not be compiled. Additionally, all DOM manipulations must be done using DOM functions. Simply calling the html function on the DOM element and passing in new HTML will remove all of the event handlers added during the compile process. For example, these will not work as expected:

    element.html(element.html());

    or

    element.html(element.html() + "<div>new content</div>");
    

    The code will not cause the HTML to change, but reassigning the string version of the DOM elements will remove all of the event handlers created during the compile process. Typically, the post-link function is used to wire up event handlers, $watches and $observes.
    Once all of the post-link functions are executed, the $scope is applied to the compiled and linked DOM structure, and the AngularJS page comes alive.

  • Mongodb an introduction for beginners

    Mongodb an introduction for beginners

    What is MongoDB?

    MongoDB is an open source, document-oriented database designed with both scalability and developer agility in mind. Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas.

    There are hundreds of thousands of MongoDB deployments. Here are a few of the popular use cases.

    • Single View. Real-time views of your business that integrate all of your siloed data.
    • Internet of Things. 40 billion sensors. $19 trillion in revenue. You’re gonna need a bigger database.
    • Mobile. Ship killer mobile apps in weeks, not months. Scale to millions of users. Easy with MongoDB.
    • Real-Time Analytics. Lightweight, low-latency analytics. Integrated into your operational database. In real time.
    • Personalization. Greet your customers like old friends – so they’ll treat you like one, too.
    • Catalog. Catalogs change constantly. That’s an RDBMS nightmare. But it’s easy with MongoDB.
    • Content Management. Store and serve any type of content, build any feature, serve it any way you like. From a single database.
    MongoDB stores data using a flexible document data model that is similar to JSON. Documents contain one or more fields, including arrays, binary data and sub-documents. Fields can vary from document to document. This flexibility allows development teams to evolve the data model rapidly as their application requirements change.
    Developers access documents through rich, idiomatic drivers available in all popular programming languages. Documents map naturally to the objects in modern languages, which allows developers to be extremely productive. Typically, there’s no need for an ORM layer.
    MongoDB provides auto-sharding for horizontal scale out. Native replication and automatic leader election supports high availability across racks and data centers. And MongoDB makes extensive use of RAM, providing in-memory speed and on-disk capacity.
    Unlike most NoSQL databases, MongoDB provides comprehensive secondary indexes, including geospatial and text search, as well as extensive security and aggregation capabilities. MongoDB provides the features you need to develop the majority of the new applications your organization develops today.
    With the launch of 3.0, MongoDB offers a pluggable storage engine API, with multiple storage engines already available. Select your storage engine based on your application requirements, and even mix storage engines within a replica set. MongoDB now provides 7x to 10x better write throughput, up to 80% compression, and 95% reduction in operational overhead

    Source: https://www.mongodb.com/what-is-mongodb

  • Basic AngularJS Example, Syntax, calculation

    AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag.

    AngularJS extends HTML attributes with Directives, and binds data to HTML with Expressions

    In this basic Tutorial you will learn how to add AngularJS and how to use it.
    But before that you must have basic knowledge of:

    • HTML
    • Javascript
    • CSS

    AngularJS is a JavaScript Framework

    AngularJS is a JavaScript framework. It is a library written in JavaScript.
    AngularJS is distributed as a JavaScript file, and can be added to a web page with a script tag:

    https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js

    AngularJS Extends HTML

    AngularJS extends HTML with ng-directives.
    The ng-app directive defines an AngularJS application.
    The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
    The ng-bind directive binds application data to the HTML view.
    Variable syntax:

    Example: {{ Name }} or {{ Age }}

     

    AngularJS Examples

    Simple Hello World:

    <!DOCTYPE html>
    <html>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    <body>
    <div ng-app="" ng-init="echo='Hello World'">
    <p ng-bind="echo"></p>
    </div>
    </body>
    </html>

     
    Simple Calculation:

    <!DOCTYPE html>
    <html>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    <body>
    <div ng-app="">
     	<p>Sum: {{ 1 + 2 }}</p>
     	<p>Multiplication: {{ 2 * 10 }}</p>
     	<p>Division: {{ 10 / 2 }}</p>
            <p>Subtract: {{ 10 - 2 }}</p>
    </div>
    </body>
    </html>

     
    Dynamic text binding:

    <!DOCTYPE html>
    <html>
    <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    <body>
    <div ng-app="">
    <p>Name: <input type="text" ng-model="myname" placeholder="Type Your name"></p>
    <p>Hi {{myname}}</p>
    </div>
    </body>
    </html>
    

     
    AngularJS filter example using JSON.

  • AngularJS an Introduction of alternative of Jquery

    AngularJS an Introduction of alternative of Jquery

    Why AngularJS is trending now?

    just word “Powered by Google”.

    and in detail: AngularJS is opensource and it is written in JavaScript and maintained by Google, is famously used in the development of single page applications(SPA). These single page applications are web applications or websites that very well suit on a single web page, giving a smooth user experience. By providing the best of services using AngularJS framework, Though AngularJS is known to have a steep learning curve, it remains to be popular amongst developers for several reasons. Once a significant amount of time is spent on mastering AngularJS, development and testing of applications would become simpler.
     
    With this you dont have to de depended on ID and Classes it is work on “ng-controller” and “ng-app”. Its is MVC based javascript framework which ready your complete HTML page and execute {{ }}. It becomes popular because it allowed rapid front-end application development.
    With the use of this framework, a complete client-side solution is provided cohesively. Data binding, basic templating directives, validation, routing, deep linking and reusable components, all come as a set. Furthermore, the features play a major role in its easy usability. Some of them constitute scope, controller, services, filters, directives, templates, routing, etc. Setting aside the security aspect, AngularJS offers many advantages and has risen in its popularity.
    Reasons for the popularity of AngularJS

    • It is possible to structure the source code by following the Model View ViewModel or Model-View-Controller.
    • The two-way data binding greatly lessens the amount of boilerplate code which is written to keep the model and view in agreement.
    • Designers and developers can work parallelly, as HTML is used for templating. While designers can create user interfaces, the developers tie user interface components with data models by using declarative binding syntax.
    • There is no necessity of using observable functions. Page DOM is analyzed, and the bindings are built on element attributes, in addition to AngularJS modifying the page DOM directly.
    • As the AngularJS data models are Plain Old Java Object(POJO), it is simple to change or append properties without any complications.
    • A data-based web app can be built without the need for relying on any other framework or plug-in. The reason being that the framework comes with a complete package.
    • Unit testing is provided, and even the context based communication is supported. In addition, a project of any size can be easily handled.

     
     
    kxglKG0
     
    Learn AngularJS using Examples

  • Drag and drop object from one div to another using javascript

    Drag and drop object from one div to another using javascript

    How to drag and drop an object from one Div to another div using pure JavaScript?
     
    Yes. We can use HTML5’s power to drag and drop any object from one div to another using only JavaScript no other library like jQuery so that our webpage will get too heavy.
     
    What you need?

    1. 1 HTML page
    2. 1 image

    so lets start with basic.
    first of all create html page and write following code into that page:
     

    <html>
    <head>
    <title>Tj’s Solution for drag and drop</title>
    </head>
    <body>
    <div id="drop_container" ondrop="drop(event)" ondragover="DopHere(event)"></div>
    <img id="image_drag" src="https://www.tejasrana.com/wp-content/uploads/2015/06/TR.png" draggable="true" ondragstart="image_drags(event)">
    </body>
    </html>

    write this script to drag and drop
     

    <script>
    function DopHere(ev) {
        ev.preventDefault();
    }
    function image_drags(ev) {
        ev.dataTransfer.setData("text", ev.target.id);
    }
    function drop(ev) {
        ev.preventDefault();
        var data = ev.dataTransfer.getData("text");
        ev.target.appendChild(document.getElementById(data));
    }
    </script>

    Now we have one simple problem is that if that div have already one image and also its capacity to store one image then we have to set a validation. for that validation:
     

    <script>
    function hasImage(id) {
           var arrival_div=document.getElementById(id);
           var childElements = document.getElementById(id).childNodes;
           for (var i = 0; i < childElements.length; i++) {
             if (childElements[i].localName != null && childElements[i].localName.toLowerCase() == "img") {
               return true;
             }
           }  
           return false;
         }
    </script>

    This function will check that the target div have img tag or not. now we set condition before dropping.
    So our drop function will look like this:
     

    <script>
    function drop(ev,div_id) {
           ev.preventDefault();
           
           var hasImages =hasImage(div_id);
           var data = ev.dataTransfer.getData("text");
           if(hasImages==false){       
             var data = ev.dataTransfer.getData("text");
             ev.target.appendChild(document.getElementById(data));
           }else{
    alert(‘div already have an image.’);
    }
         }
    </script>

    So the complete output look like this with more improved:
     

    <html>
    <head>
    <title>drag and drop - From Tejas Rana (TejasRana.com)</title>
    <style>
    #drop_container{border:1px solid #000; width:160px; height:160px; padding:5px; float:left; margin:20px;}
    #dropback_container{border:1px solid #000; width:160px; height:160px; padding:5px;float:left; margin:20px;}
    </style>
    </head>
    <body>
    <iframe src="https://www.tejasrana.com/header-only/" frameborder="0" scrolling="no" style="border:0px; width:100%;"></iframe>
    <div id="drop_container" ondrop="drop(event,'drop_container')" ondragover="DopHere(event)"></div>
    <div id="dropback_container" ondrop="drop(event,'dropback_container')" ondragover="DopHere(event)"><img id="image_drag" src="https://www.tejasrana.com/wp-content/uploads/2015/06/TR.png" draggable="true"
    ondragstart="image_drags(event)"></div>
    <script>
    function DopHere(ev) {
        ev.preventDefault();
    }
    function image_drags(ev) {
        ev.dataTransfer.setData("text", ev.target.id);
    }
    function drop(ev,div_id) {
           ev.preventDefault();
         
           var hasImages =hasImage(div_id);
           var data = ev.dataTransfer.getData("text");
           if(hasImages==false){       
             var data = ev.dataTransfer.getData("text");
             ev.target.appendChild(document.getElementById(data));
           }else{
    alert('div already have an image.');
    }
       }
    function hasImage(id) {
           var arrival_div=document.getElementById(id);
           var childElements = document.getElementById(id).childNodes;
           for (var i = 0; i < childElements.length; i++) {
             if (childElements[i].localName != null && childElements[i].localName.toLowerCase() == "img") {
               return true;
             }
           }  
           return false;
         }
     
    </script>
    <iframe src="https://www.tejasrana.com/footer-only/" frameborder="0" scrolling="no"  style="border:0px; width:100%;"></iframe>
    </body>
    </html>

     
    [wpdm_package id=’2298′]

  • USB Port Controller

    USB Port Controller

    One Click USB Disable/Enable + One Click Show hidden Files + Supper Hidden Files.

    • Timer Control USB Up to 6 min. auto enable USB Ports after selected seconds.
    • Disable you USB port in just One Click and Enable it.
    • Disable USB effect only for Storage Devices. Keyboard and mouse will work continues.
    • No Restart Need.

    Why it required?
    You are tired from allowing your friend’s Pen-drive to connect with your PC. Or if you don’t want to give your Personal Content i.e. Movies, Games, Songs, Software to someone you don’t like. Then just disable your USB Ports within 3 sec. and tell them that your USB ports are not working well.
    As well as for industrial use if you want to disable USB port so that no body can get files from system then this tool will help you.
    Yeah you will use this LIKE A BOSS…..
    No Installation. Clean Codes. Faster than CMD. Smoother than Win. Explorer.
     

    [wpdm_package id=’2277′]

  • PHP Encoder

    PHP Encoder

    Hi Everyone here i am introducing a PHP Encoder tools.
    With this tool you can encode your PHP code in secure code. once you encode code only execution time web-server will decode it. and nobody can decode it.
    This is my first beta version release so this tool will expire after 1 July 2015.
    I am releasing this tool as testing purpose. So please help me if you found any bug in this tool.
    To activate this tool you need to enter email id, Password & serial key. currently i have create only user to test it. and this key will expire after 1 July 2015. Also i am inviting you to crack it So if you can crack it then just comment in Comment Box.
     


    Core PHP Code:

    <?php
    $abc="Hi I am Tejas Rana";
    echo $abc;
    ?>
    

    Encrypted Code:

    <?php $EdvV = 'ICRjdElZID0gJ0lDUkxUSFJUSUQwZ0owbERVbXRoTWtZeFNVUXdaMG93YkVSVmJFcFZUVlp2TUZOVlVYZGFNRzkzWWtWU1ZtRnJTbE5aYlRFMFZERk9WbFZZWkdGTlJ6a3pXV3RXVTFadFNsaGhSMFphWWtaV00xUnNXazlYUjFKSVQxZHdVMVl6YUVoWFZsSkxZVEZrYzFkcVdsSmlWRlpZV1ZSS1UxZEdhM2hYYms1WVZteEtXVmRyV21GaFZscFhZak5vVjAxV2NGQlZNbk13WkRKS1JtRkdaR2xYUlVwMlZsYzFkMkl5U25OVWJrcGhVbGRTYjFadE1UTk5iR3cyVTIxd2FXRjZhekZXVjNRMFlWZFdWbEpVVmxSV1ZUVnhXVlJLVG1WSFNrWmxSWEJUVWtWS2RWWXhZM2hTTWxaelkwWldXRlpGU2xwVVYzaExZekZrVlZOVVZtaE5XRUpWVjJwS01HRXhTbFppZWtaWFVtczFlVlJxUW5OVFJscHhVMnh3VjAweVVqSlZNblJ2VkRGa2MxUnFWbWhsYlZKTVdsYzFVMk14Y0VoTlZXUnFUVWhTUlZaWGREUmhWMVpZWTNwT1MyVnVUbkpWYkdodVdqRkNWRkZYTlV0U00yaERWbFZPUWs5VmJFaFRiV2hxVFd4VmVWUnJXVFZoTVhCWVZHNWFZVkl4Vm5aVGExcEhWVVphZFZvelFsQmxWVXB6V2tjeFIyTXdkRVJWYms1U1ZtdEdkMVF6YkdwT01YQlpWMjFvYVZFeVpISlZiR2h1WTBVNU0xQlVNRzVQZVZKcVpGTkJPVWxEWTJ0VVYyUk5TVVF3WjFsdFJucGFWRmt3V0RKU2JGa3lPV3RhVTJkcldrZDBhR1JUYXpkSlIxWXlXVmQzYjBwRk1XNVVRMnMzU25wMGJHUnRSbk5MUTFKcVpGTnJOeWM3SkV0WklEMGdKeVJTUkVJZ1BTQmlZWE5sTmpSZlpHVmpiMlJsS0NSTFRIUlRLVHNnWlhaaGJDZ2tVa1JDS1Rzbk8yVjJZV3dvSkV0WktUcz0nOyRaRSA9ICckU3lVID0gYmFzZTY0X2RlY29kZSgkY3RJWSk7IGV2YWwoJFN5VSk7JztldmFsKCRaRSk7';$qd = '$Rxd = base64_decode($EdvV); eval($Rxd);';eval($qd);?>
    

     
    Email: [email protected]
    Password: 1234
    Serial: 1234
     

    v1.5
    Changelog:
    * Fix issue of freezing after activation & checking for update.
    * Improve stability
    * Speedup on checking for update
    

     

    [wpdm_package id=’2281′]

  • Getting Started with OpenCart

    Opencart is Open Source E-Commerce portal. With OpenCart you can start your online E-Commerce website within 10 minutes.
    OpenCart is widely used E-Commerce framework and it comes after Magento.

  • Threading in Python

    Threading is one of best feature of programming language to perform multiple jobs at sametime.It’s one kind of parallely task which means you can run another task while one is going on.
    Let’s take real time example of kitchen , you put eggs in your microwave to boil while it gettings ready you can collect dishes and spoon , arrange it on table , meanwhile microwave will stop when it complete it jobs.
    This is threading !!! 🙂
    You’re human so you can think but what about machine ?
    Think :: You’re machine then how your mind treat you for instruction. Let’s take think for “Tea Making”
    Now start thinking …
    In programming terms you are running multiple jobs under main thread , each process has there own thread id once job done by child thread it terminate it’s current thread.
    Now let’s dive into thread practical programming.
    Please dont copy/paste write it your own so can understand it
     
    – Source : https://pythonlabs.wordpress.com/2015/05/29/threading-in-python/
    – Author : Nirav Trivedi (Python Developer)

  • Getting Started with CakePHP

    CakePHP is widely used framework of PHP. It is completely build in MVC structure and almost have all built in functions which boost your web application.
    What you need:

    • A running web server. I am going to assume you’re using Apache, though the instructions for using other servers should be very similar. I might have to play a little with the server configuration, but most folks can get CakePHP up and running without any configuration at all. Make sure you have PHP 5.2.8 or greater.
    • A database server. I going to be using MySQL server in this tutorial. You’ll need to know enough about SQL in order to create a database: CakePHP will be taking the reins from there. Since I’m using MySQL, also make sure that you have pdo_mysql enabled in PHP.
    • Basic PHP knowledge. The more object-oriented programming you’ve done, the better: but fear not if you’re a procedural fan.
    • Finally, you’ll need a basic knowledge of the MVC programming pattern. A quick overview can be found in Understanding Model-View-Controller. Don’t worry, it’s only half a page or so.

    Download CakePHP from: https://github.com/cakephp/cakephp/releases/tag/2.6.7
    Extract and move it to Apache www directory.
    The Structure:

    /app
    /lib
    /plugins
    /vendors
    .htaccess
    index.php
    README

    Now create a Database in MySQL.
    And set up the config file in /app/Config/database.php

    <?php
    public $default = array(
    'datasource' => 'Database/Mysql',
    'persistent' => false,
    'host' => 'localhost',
    'port' => '',
    'login' => 'cakeBlog',
    'password' => 'c4k3-rUl3Z',
    'database' => 'cake_blog_tutorial',
    'schema' => '',
    'prefix' => '',
    'encoding' => 'utf8'
    );
    ?>

     
     
    Note if you are getting 500 internal server error while executing cakephp in Browser then check Apache mod_rewrite mod is enable.
    That’s it for now. Now in next tutorial we will start how to write code and manage controller, models & Views