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
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
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'); ?>
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
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
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
What does MVC stand for?
1.Module-vector-core
2.Maximum-velocity-counter
3.Modular-view-controlling
4.Model-view-controller
What is a .ctp file?
1.Common Timing Protocol
2.Twig Template
3.PHP Container File
4.CakePHP Template
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.
What is the default action for a controller?
1.index() function
2._index() function
3.control() function
4.None of These
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
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
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
Which CakePHP entities can the Bake console create?
1.Model
2. Controller
3.View
4. All of these
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')
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)
Which file is processed first?
1.index.php
2.bootstrap.php
3.both (a) and (b)
4.None of These
Which function is executed before every action in the controller.
1.firstFilter
2.beforeFilter
3.All of above
4.afterFilter
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() {
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");