Here there are many questions and answers about How CakePHP Framework works? and basic questions related to CakePHP framework functionality.
Q-1 What is CakePHP ?
Ans. CakePHP is a free, open-source, rapid development framework for PHP. It’s a foundational structure for programmers to create web applications. There is number of in built component like Ajax, RequestHandler, Session etc
Q-2 What are are drawbacks of cakephp.
Ans. The learning curve, and it loads full application before it starts your task. Its not recommended for small projects because of its resource heavy structure.
Q-3 What is MVC (model, view, and controller) in cakephp?
Ans. Model–view–controller (MVC) is an architectural pattern used in software engineering.
Model: Databases function exist in the model
View: Design parts written here
Controller: Business Login
Q-4 What is the name of Cakephp database configuration file name and its location?
Ans. Default file name is database.php.default.
Its located in “/app/config/database.php.defaut”
Q-5 What are component, helper and why are they used?
Ans. A component is an independent piece of code written for specific task that can be used(Eg Email, Ajax, RequestHandler and Session).
A helper is used for helping cakephp in rendering the data to be shown to user with views(Eg Form, HTML etc).
Q-6 What are commonly used components of cakephp?
ACL(Access control lists)
Q-7 What is default function and default controller of cakephp which is called automatically?
Ans. Default controller is indexController.php and Default function is index.
Q-8 How cakephp URL looks in address bar?
Q-9 Why cakephp have two vendor folder?
Ans. There is two vendor folder, one folder in root and another is in “app” folder
Q-10 List some database related functions in cakephp.
Ans. find, findAll , findAllBy , findBy , findNeighbours and query.
Q-11 List some of the features in Cakephp
Ans. Following are some feature of Cakephp.
Q-12 can you remember what is the directory structure when you download cakephp?
Q-13 List some of the features in Cake php.
1. Compatible with versions 4 and 5 of PHP
2. MVC architecture
3. Built-in validations
Q-14 What is the naming convention in cakephp?
Ans. Table names are plural and lowercased,model names are singular and CamelCased: ModelName, model filenames are singular and underscored: model_name.php, controller names are plural and CamelCased with *Controller* appended: ControllerNamesController, controller filenames are plural and underscored with *controller* appended: controller_names_controller.php,
Q-15 How can we use ajax in cakephp?
Ans. By calling ajax helper and then using it in controller for rendering.
Q-16 What is a component,helper and why are they used, is there other way we can do same thing, what is better.
Ans. A component is an independent piece of code written for specific task that can be used by calling in controllers (example : email component), helper is used for helping cakephp in rendering the data to be shown to user with views, these only adds to modularity in code otherwise same coding can be implemented in conrollers.
Q-17 If you have to validate a registration module for a user, what all can be possible ways , which one is the best?
Q-19 What is a Component in cakephp?
Ans. Components are packages of logic that are shared between controllers. They are useful when a common logic or code is required between different controllers.
Q-20 What are commonly used components of cakephp?
3. Access control lists
7. Request handling