Advanced CAKEPHP Interview Questions
- Dhanush Kuppusamy
- 06th Sep, 2021
- 369 Followers
Latest Interview Questions
Pratice HR Questions
Cakephp is an open-source PHP web framework for creating websites and mobile APIs. It follow MVC approach of development and written in PHP. CakePHP is built on ruby concepts and released under MIT License.The current stable version of CakePHP is 3.8.3 and require PHP version greater than 5.6.0
Cakephp interview questions
1) What is CakePHP?
CakePHP is an open-source web framework. It follows the model–view–controller approach and is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License.
2) What is MVC in CakePHP?
Model–view–controller (usually known as MVC) is a software design pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements.
3) What are hooks in CakePHP?
Hooks in CakePHP are the functions that we can call before and after doing any task in Models ( database related ). Like after finding data, before saving data etc.
4) What is Composer?
Composer is a dependency manager for PHP. Composer will allow you to manage your libraries, classes, and functions throughout your applications. These libraries and classes that you create for Composer are referred to as Packages.
5) What is minimum server requirements to install CakePHP?
Minimum server requirements to install CakePHP are
- HTTP Server. Like Apache. Having mod_rewrite is preferred, but by no means required.
- PHP 5.6.0 or greater (including PHP 7.1).
- mbstring PHP extension installed and enabled
- intl PHP extension
- simplexml PHP extension
6) List various type of caching engines supported by CakePHP?
Caching can be used to make reading from expensive or slow resources faster, by maintaining a second copy of the required data in a faster or closer storage system.
There are 5 built-in caching engines supported by CakePHP:
FileEngine- Uses simple files to store content. Poor performance, but good for storing large objects, or things that are not IO sensitive.
ApcEngine- Uses the APC object cache, one of the fastest caching engines.
MemcacheEngine- Uses the PECL::Memcache extension and Memcached for storage. Fast reads/writes, and benefits from memcache being distributed.
XcacheEngine- Uses the Xcache extension, an alternative to APC.
WincacheEngine- Uses Windows Cache Extension for PHP. Supports wincache 1.1.0 and higher.
7) What types of associations supported by CakePHP?
CakePhp mainly supports four association types. They are
- hasOne: One to One Relationship
- hasMany: One to many Relationship
- belongsTo: Many to One Relationship
- hasAndBelongsToMany (HABTM):Many to Many Relationship
8) What are helpers in CakePHP?
Helpers in Cakephp are the component-like classes for the presentation layer of your application. They contain presentational logic that is shared between many views, elements, or layouts.
CacheHelper, FlashHelper,FormHelper,HtmlHelper,JsHelper ,NumberHelper ,PaginatorHelper ,RssHelper ,SessionHelper ,TextHelper, TimeHelper are few builtin helpers in Cakephp.
9) What are components in Cakephp?
Components in Cakephp are packages of logic that are shared between controllers. CakePHP comes with a fantastic set of core components you can use to aid in various common tasks.
Authentication, Cookie, Cross Site Request Forgery, Flash, Security, Pagination, Request Handling are few builtin components in CakePHP.
10) How to set a layout in Cakephp from controller?
You can set a layout in cakephp from controller using
11) How to get current url in CakePHP?
You can use
$this->request->here() to get the current url in CakePHP.
12) What is behaviour in CakePHP?
Behaviors in CakePHP are a way to organize and enable horizontal re-use of Model layer logic. Conceptually they are similar to traits. However, behaviors are implemented as separate classes. This allows them to hook into the life-cycle callbacks that models emit, while providing trait-like features.
Behaviors provide a convenient way to package up behavior that is common across many models.
13) What is full form of HABTM?
The Full form of HABTM is HasAndBelongsToMany.
14) List some database related query function available in Cakephp?
Model::find(), Model::field(), Model::read(), Model::set(), Model::clear(), Model::create(),Model::saveField(), etc are few database related functions available in CakePHP.
15) What are templates in Cakephp?
Templates in CakePHP are the part of the page that is unique to the action being run. They form the meat of your application’s response.
16) What is scaffolding in CakePHP?
Scaffolding is a technique that allows a developer to define and create a basic application that can create, retrieve, update and delete objects. Scaffolding in CakePHP also allows developers to define how objects are related to each other, and to create and break those links.