CakePHP/CakePHP MCQ Sample Test,Sample questions

Question:
By default, what controller action will be invoked if the action is not specified in the URL?

1.index

2.view

3.default

4.add


Question:
How is the AppController class defined?

1.public function beforeFilter() { parent::beforeFilter(); }

2.class AppController extends Controller { }

3.$data = array( 'color' => 'pink', 'type' => 'sugar'

4.None of these


Question:
How will you include an element (header/footer etc.) within a layout?

1.<?php echo $this->element('element_name'); ?>

2.<?php include('element_name'); ?>

3.<?php echo $this->set('element_name'); ?>

4.<?php echo $this->include('element_name'); ?>


Question:
In cakePHP 2.x , the recursive property defines:

1.how deep CakePHP should go to fetch associated model data via find(), and read() methods

2.how many records to fetch by data via find(), and read() methods

3.how many time the find(), and read() methods are called

4.None of these


Question:
Is it possible to define custom data retrieval methods and if so, where would you define them?

1.Yes, create a component

2.Yes, in the routes

3.Yes, in the model

4.No, good luck


Question:
The Bake console can be used to create:

1.models only

2.models and views only

3.models, views and controllers

4.models and controllers only


Question:
What does MVC stand for?

1.Module-vector-core

2.Maximum-velocity-counter

3.Modular-view-controlling

4.Model-view-controller


Question:
What is a .ctp file?

1.Common Timing Protocol

2.Twig Template

3.PHP Container File

4.CakePHP Template


Question:
What is the AppController class?

1.It sets the initial configuration for plugins and caching.

2.It builds and manages paths to various components of the application.

3.It is responsible for converting the POST parameters into a request object.

4.It is the parent class to all of the application’s controllers.


Question:
What is the default action for a controller?

1.index() function

2._index() function

3.control() function

4.None of These


Question:
What is the name of the CLI console that comes with CakePHP and helps you get your project up and running fast by generating models, views, and controllers from templates.

1.grunt

2.rake

3.composer

4.bake


Question:
What kind of functionality does the Security Component provide?

1.Form tampering protection

2.Requiring that SSL be used

3.Restricting which HTTP methods the application accepts

4.All of these


Question:
What should be done before deploying a CakePHP application?

1.Set document root to app/webroot

2.Make sure data is sanitized and validated

3.Disable exception stack traces

4.All of the above


Question:
Which CakePHP entities can the Bake console create?

1.Model

2. Controller

3.View

4. All of these


Question:
Which data retrieval function call is most suitable to build input select boxes?

1.find('select')

2.find('first')

3.find('list')

4.find('all')


Question:
Which data retrieval function will return one result only?

1.find('list', $options)

2.find('one', $options)

3.find('first', $options)

4.find('threaded', $options)


Question:
Which file is processed first?

1.index.php

2.bootstrap.php

3.both (a) and (b)

4.None of These


Question:
Which function is executed before every action in the controller.

1.firstFilter

2.beforeFilter

3.All of above

4.afterFilter


Question:
Which of the following is an example of a model definition in CakePHP?

1.None of these

2.App::uses('AppModel', 'Model'); class Ingredient extends AppModel { public $name = 'Ingredient'; }

3.CakePlugin::loadAll(); // Loads all plugins at once CakePlugin::load('ContactManager'); //Loads a single plugin

4.class IngredientsController extends AppController { public function index() {


Question:
You want to generate three instances of a model form within the context of a view. What syntax is most correct to use with FormHelper::input() ? $i represents an incremented variable.

1.$this->Form->input("fieldname.$i.Modelname");

2.$this->Form->input("$i.Modelname.$i.fieldname");

3.$this->Form->input("Modelname.$i.fieldname");

4.$this->Form->input("$i.fieldname");


More MCQS

  1. CakePHP MCQ
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!