Saturday, April 30, 2016

Cake PHP Descriptive Question for IDB-bisew it scholarship

Posted by Tech Talim

Ch-1
1.       What is CakePHP?
Ans: CakePHP is a free, open-source, rapid development framework for PHP. It’s a foundational structure for programmers to create web applications.

Ch-2
1.       How can you configure your CakePHP Database?
In CakePHP the default database file name is database.php.default.
It is located at "/app/config/database.php.default". To connect with our database it should be renamed to database.php

2.      What are the purposes of using security.salt and Security.cipherSeed?
The Security.salt is used for generating hashes. We can change the default Security.salt value by editing from /app/Config/core.php.  

The Security.cipherSeed is used for encrypt/decrypt strings. We can change the default Security.cipherSeed value by editing /app/Config/core.php.

Ch-3
1.       How can you set the routing information in CakePHP?
CakePHP’s routing is found in /app/Config/routes.php. From this file we can set the routing information.

2.       What conventions are followed in creating CakePHP Controller?
     Controller class names are plural, CamelCased, and end in Controller. PeopleController and 
     LatestArticlesController are both examples of conventional controller names.

3.       What conventions are followed in creating CakePHP model and view?
Ø  Model class names are singular and CamelCased. Person, BigPerson, and ReallyBigPerson are all examples of conventional model names.

Ø   View template files are named after the controller functions they display, in an underscored form. The getReady() function of the PeopleController class will look for a view template in /app/View/People/get_ready.ctp.

4.       What are the purposes of using Config, Controller, Model, view and plugin folders?
Config: Holds the (few) configuration files CakePHP uses. Database connection details, bootstrapping, core configuration files and more should be stored here.

      Controller: Contains our application’s controllers and their components.

      Model:  Contains your application’s models, behaviors, and datasources.

       View : Presentational files are placed here: elements, error pages, helpers, layouts, and 
                  view files.
Plugin Contains plugin packages.

5.       Which are used for application, controller, model and view extensions?
Controller Extensions (“Components”)
Model Extensions (“Behaviors”)
View Extensions (“Helpers”)
Ch-5
1.       What are the features of CakePHP?
  Flexible licensing
 Compatible with versions PHP 5.2.8 and greater
  Integrated CRUD for database interaction
  Application scaffolding
 Code generation
  MVC architecture

2.       What are Model, View and Controller?
The Model layer represents the part of your application that implements the business logic. It is responsible for retrieving data and converting it into meaningful concepts for your application.
The View renders a presentation of modeled data. Being separated from the Model objects, it is responsible for using the information it has available to produce any presentational interface your application might need.

The Controller layer handles requests from users. It is responsible for rendering a response with the aid of both the Model and the View layer.

3.       What are benefits of using CakePHP?
Ø  it is a tried and true software design pattern that turns an application into a maintainable, modular, rapidly developed package.
Ø  Crafting application tasks into separate models, views, and controllers makes our application very light on its feet.

Ø  New features are easily added.

Ø  The modular and separate design also allows developers to make changes in one part of the application without affecting the others.
Ch-6
1.       What is the function of App Controller?
the AppController class is the parent class to all of our application’s controllers.

2.      What are the purposes of using CakePHP’s Router and Dispatcher class?
When a request is made to a CakePHP application, CakePHP’s Router and Dispatcher classes use Routes Configuration to find and create the correct controller.

3.      What functions of controller are used for request life-cycle callbacks?
beforeFilter(): This function is executed before every action in the controller.

beforeRender(): Called after controller action logic, but before the view is rendered.

afterFilter(): Called after every controller action, and after rendering is complete.

4.      What are the functions of set, render, redirect and flash methods?
The set() method is the main way to send data from controller to view.
The render() method is automatically called at the end of each requested controller action.
      The redirect(). This method takes its first parameter in the form of a CakePHP-relative URL.

     The flash() method is used to direct a user to a new page after an operation. The flash()   
     method is different in that it shows a message before passing the user on to another URL.

5.      Write the purpose of using $components, $helpers and $uses property?
Using these attributes make MVC classes given by $components and $uses available to the controller as class variables ($this->ModelName, for example) and those given by $helpers to the view as an object reference variable ($this->{$helpername}).

6.      What is scaffolding?
Scaffolding is a technique that allows a developer to define and create a basic application that can create, retrieve, update and delete objects. Scaffolding in CakePHP also allows developers to define how objects are related to each other, and to create and break those links.

7.      What is component?

Components are packages of logic that are shared between controllers. . They are useful when a common logic or code is required between different controllers.

0 comments:

Post a Comment