Cake PHP Set 2
Free Online Best Cake PHP MCQ Questions for improve your basic knowledge of Cake PHP. This Cake PHP Set 2 test that contains 25 Multiple Choice Questions with 4 options. You have to select the right answer to a question.
Start
Congratulations - you have completed Cake PHP Set 2.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
How To Get Controller Name In CakePHP Views?
A | $this->request->params['controller'] |
B | $this->get->params['controller'] |
C | $this->request->action['controller'] |
D | $this->request->params['params'] |
Question 2 |
In general, filenames match the classnames, which are:
A | uppercase |
B | lowercase |
C | CamelCased |
D | Capitalized |
Question 3 |
CSRF protection is provided in CakePHP 2.x in
A | SecurityMethods |
B | SecurityPlugin |
C | SecurityComponent |
D | none |
Question 4 |
Which class handles request parameters and contains any data submitted with the request?
A | CakeResponse |
B | CakeRequest |
C | HttpSocketRequest |
D | RequestHandler |
Question 5 |
How to pass multiple parameters to access into the view files?
A | $this->get(compact()) |
B | $this->set(compact()) |
C | $this->write(compact()) |
D | $this->route(compact()) |
Question 6 |
which is valid Hooks in CakePHP ?
A | beforeSave() |
B | afterSave() |
C | beforeFind() |
D | all |
Question 7 |
How to do cakephp version check?
A | echo Configure::getversion() |
B | echo Configure::version() |
C | echo $configure::version() |
D | echo cake::version() |
Question 8 |
To take a advantage of the validation features in cakephp, you'll need to use Cake's FormHelper in your:
A | action |
B | helper |
C | views |
D | controller |
Question 9 |
In cakephp,the view /template file extension is:
A | php |
B | ctp |
C | html |
D | ctm |
Question 10 |
The Bake console can be used to create:
A | models and views only |
B | models only |
C | models and controllers only |
D | models, views and controllers |
Question 11 |
How to read session?
A | $session->get('username'); |
B | $session->read('username'); |
C | $session->find('username'); |
D | $session->allow('username'); |
Question 12 |
How to get current URL in CakePHP?
A | echo $this->cake->url(null, true); |
B | echo $this->url(null, true); |
C | echo $this->Html->url(null, true); |
D | echo $this->route->url(null, true); |
Question 13 |
Which helper use to create a forms quickly?
A | HTMLHelper |
B | FormHelper |
C | JsHelper |
D | CacheHelper |
Question 14 |
Actions are methods on a ________ that handle requests.
A | components |
B | controller |
C | models |
D | views |
Question 15 |
How will you include an element (header/footer etc.) within a layout?
A | element(‘element_name’); |
B | include(‘element_name’); |
C | set(‘element_name’); |
D | write(‘element_name’); |
Question 16 |
What CakePHP component is not part of the View layer?
A | Element |
B | Helper |
C | Behavior |
D | Layout |
Question 17 |
View extensions in CakePHP is called
A | Components |
B | Behaviors |
C | Helpers |
D | all |
Question 18 |
As related to the web server configuration, where is the index file properly located?
A | webroot directory |
B | top-level directory. |
C | system root directory |
D | app directory |
Question 19 |
CakePHP does not support composite primary keys.
A | TRUE |
B | FALSE |
C | none |
D | may be true |
Question 20 |
$this->Html is the instance of cakephp's________class.
A | HtmlHelper |
B | ViewHelper |
C | htmlhelper |
D | viewHelper |
Question 21 |
Which by is not a core find type provided by CakePHP?
A | first |
B | active |
C | threaded |
D | neighbors |
Question 22 |
Which Helper contains method to make text more usable and friendly in our views?
A | HTMLHelper |
B | JsHelper |
C | FormHelper |
D | TextHelper |
Question 23 |
How to create session?
A | $session->write('username', 'admin'); |
B | $session->set('username', 'admin'); |
C | $session->add('username', 'admin'); |
D | $session->addto('username', 'admin'); |
Question 24 |
What class in CakePHP must be active in order for a user to see the error, “The request has been black-holed”?
A | RequestHandlerComponent |
B | BaseAuthenticate |
C | AuthComponent |
D | SecurityComponent |
Question 25 |
What happens if CakePHP can’t find a file for a model object in the /app/Model folder?
A | Deletes the controller |
B | Generates an internal server error |
C | Generates a SQL error |
D | Dynamically creates a model object |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
Get Results
There are 25 questions to complete.
← |
List |
→ |
Return
Shaded items are complete.
1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 |
End |
Return
You have completed
questions
question
Your score is
Correct
Wrong
Partial-Credit
You have not finished your quiz. If you leave this page, your progress will be lost.
Correct Answer
You Selected
Not Attempted
Final Score on Quiz
Attempted Questions Correct
Attempted Questions Wrong
Questions Not Attempted
Total Questions on Quiz
Question Details
Results
Date
Score
Hint
Time allowed
minutes
seconds
Time used
Answer Choice(s) Selected
Question Text
All done
Need more practice!
Keep trying!
Not bad!
Good work!
Perfect!