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

Posted Date:-2022-08-10 11:26:33


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

Posted Date:-2022-08-10 11:20:24


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'); ?>

Posted Date:-2022-08-10 12:00:00


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

Posted Date:-2022-08-10 11:15:23


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

Posted Date:-2022-08-10 11:07:43


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

Posted Date:-2022-08-10 11:21:48


Question:
What does MVC stand for?

1.Module-vector-core

2.Maximum-velocity-counter

3.Modular-view-controlling

4.Model-view-controller

Posted Date:-2022-08-10 11:23:45


Question:
What is a .ctp file?

1.Common Timing Protocol

2.Twig Template

3.PHP Container File

4.CakePHP Template

Posted Date:-2022-08-10 11:19:18


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.

Posted Date:-2022-08-10 11:17:34


Question:
What is the default action for a controller?

1.index() function

2._index() function

3.control() function

4.None of These

Posted Date:-2022-08-10 11:25:32


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

Posted Date:-2022-08-10 12:01:33


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

Posted Date:-2022-08-10 11:12:30


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

Posted Date:-2022-08-10 11:16:27


Question:
Which CakePHP entities can the Bake console create?

1.Model

2. Controller

3.View

4. All of these

Posted Date:-2022-08-10 11:04:20


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')

Posted Date:-2022-08-10 11:06:23


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)

Posted Date:-2022-08-10 11:27:53


Question:
Which file is processed first?

1.index.php

2.bootstrap.php

3.both (a) and (b)

4.None of These

Posted Date:-2022-08-10 11:13:55


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

1.firstFilter

2.beforeFilter

3.All of above

4.afterFilter

Posted Date:-2022-08-10 11:59:01


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() {

Posted Date:-2022-08-10 11:09:07


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");

Posted Date:-2022-08-10 11:10:07


More MCQS

  1. CakePHP MCQ
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website 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!