CakePHP MCQ Questions
11. Which of the following is not an advantage of CakePHP?
A. Hard CRUD
B. Built-in Validation
C. Search Engine Friendly URLs
D. MVC Framework
View Answer
Ans : A
Explanation: Easy CRUD (Create, Read, Update, Delete) Database Interactions.
12. Which folder holds the Cake console executables?
A. config
B. bin
C. logs
D. plugins
View Answer
Ans : B
Explanation: The bin folder holds the Cake console executables.
13. Which directory is the public document root of your application?
A. webroot
B. vendor
C. tmproot
D. testroot
View Answer
Ans : A
Explanation: The webroot directory is the public document root of your application. It contains all the files you want to be publically reachable.
14. Configuration for Email defaults is created using ?
A. config()
B. configTransport()
C. configEmail()
D. Both A and B
View Answer
Ans : D
Explanation: Configuration for Email defaults is created using config() and configTransport().
15. Which method is called after the view has been rendered, but before the layout rendering has started?
A. Helper::afterRender(Event $event, $viewFile)
B. Helper::beforeLayout(Event $event, $layoutFile)
C. Helper::afterLayout(Event $event, $layoutFile)
D. Helper::afterRenderFile(Event $event, $viewFile, $content)
View Answer
Ans : A
Explanation: Helper::afterRender(Event $event, $viewFile) => This method is called after the view has been rendered, but before the layout rendering has started.
16. How many types of Authentication CakePHP supports?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: Authentication is the process of identifying the correct user. CakePHP supports three types of authentication. FormAuthenticate, BasicAuthenticate, DigestAuthenticate.
17. Which allows you to authenticate users using Digest HTTP authentication?
A. FormAuthenticate
B. BasicAuthenticate
C. DigestAuthenticate
D. None of the above
View Answer
Ans : C
Explanation: DigestAuthenticate : It allows you to authenticate users using Digest HTTP authentication.
18. What is true about errorLevel?
A. The level of errors you are interested in capturing
B. Include stack traces for errors in log files.
C. The class responsible for rendering uncaught exceptions.
D. An array of exception class names that should not be logged.
View Answer
Ans : A
Explanation: errorlevel : The level of errors you are interested in capturing. Use the built-in php error constants, and bitmasks to select the level of error you are interested in.
19. What is the first file that gets loaded when you run an application using a cakephp?
A. index.php
B. config.php
C. bootstrap.php
D. core.php
View Answer
Ans : A
Explanation: index.php is the first file that gets loaded when you run an application using a cakephp.
20. Which by is not a core find type provided by CakePHP?
A. first
B. all
C. active
D. threaded
View Answer
Ans : C
Explanation: Active is not a core find type provided by CakePHP.
Discussion