Skip to content
Interview Shortout
  • Home
  • Articles
  • PHP
  • Python
  • Java Script
  • MySQL
  • Magento
  • Startups
  • Other

CakePHP Advance Interview Questions

Posted on August 24, 2018August 22, 2022 By Dhananjay No Comments on CakePHP Advance Interview Questions
CakePHP, Interview, PHP

What is the default cache Engine in CakePHP?

File Engine is the default cache Engine in Cake PHP.

What are the cache engines that CakePHP support?

Different type of cache engine supported by Cake PHP:

  1. File
  2. APC
  3. Win
  4. Xcache
  5. Memcache
  6. Redis

How many type of Associations are there in CakePHP Models?

There are four association types in CakePHP:

  1. One to One – hasOne  e.g.  A user has one profile.
  2. One to Many – hasMany  e.g.  A user can have multiple recipes.
  3. Many to One – belongsTo e.g. Many recipes belong to a user.
  4. Many to Many hasAndBelongsToMany e.g. Recipes have, and belong to, many ingredients.

How to create association?

Model association example:

class Toy extends AppModel {
public $hasOne = 'Profile';
public $hasMany = array(
'Toy' => array(
'className' => 'Toy', 
'conditions' => array('Toy.approved' => '1'), 
'order' => 'Toy.created DESC'
));
}

How to create Pagination in List view?

Cake PHP has a built in component ‘Paginator’. We can use this Component to create Pagination.

How to destroy an association?

Use ‘unbindModel‘ to destroy a particular type of association.

$this->Leader->unbindModel(
array('hasMany' => array('Follower'))
);

Give an example of LEFT JOIN using CakePHP ORM?

LEFT JOIN example using Cake PHP ORM:

$options['joins'] = array(
array('table' => 'channels',
'alias' => 'Channel',
'type' => 'LEFT',
'conditions' => array('Channel.id = Item.channel_id')));
$Item->find('all', $options);

How to prevent the default View and Layout to be rendered?

We can set the default view and default Layout variable to false.

$this->layout=''; 
$this->autoRender = false;

What is layout in CakePHP?

View files that contain representational code that wraps many interfaces in your application. Most views are rendered inside a layout.

What Is A Component In CakePHP?

Components are packages shared between controllers. They are useful when a common logic or code is required between different controllers.

What are most used Components in CakePHP?

There may be unlimited number of component in a PHP project. Few components are already there in CakePHP and they are frequently and commonly used components.  We have listed few such components:-

  1. Security
  2. Sessions
  3. Access control lists
  4. Emails
  5. Cookies
  6. Authentication
  7. Request handling
  8. Scaffolding

What Is A Behavior?

Behavior in CakePHP is associated with Models. Behaviour is used to change the way models behaves and enforcing model to act as something else.

Post navigation

❮ Previous Post: CakePHP Interview Questions and Answers
Next Post: CakePHP Advance : Most Common Interview Questions ❯

Leave a Reply Cancel reply

You must be logged in to post a comment.

Doglapan

Recent Posts

  • Captable for Startups?
  • What is chat GPT?
  • All about Indexing in MySQL
  • Exploring the Growth and Future of Fintech Companies in Indian Startup Culture
  • Angel Investors in the Indian Startup Ecosystem: Understanding their Characteristics, Benefits and Role

Popular

AJAX artificial intelligence CakePHP Career Certifications CodeIgniter COVID Database Data Science DBMS DevOps Django Drupal ES6 Google Analytics HR Internship Interview Java Script jQuery Magento MVC MySQL PHP reactjs Risk Management Startups Training Visual Basic

Categories

  • AJAX
  • AJAX Interview Questions
  • Android
  • Articles
  • Artificial Intelligence
  • Banking
  • Big Data
  • Cake PHP Interview Questions
  • CakePHP
  • Career Guide
  • Certifications
  • CI/CD
  • Codeigniter Interview Questions
  • Codeigniter4
  • CSS
  • Data Science
  • DBMS
  • DevOps
  • Drupal
  • ES6 Interview Questions
  • Fresher Interview
  • Google Analytics
  • Gov Job
  • HR Interview
  • HTML
  • Internship
  • Interview
  • Java Script
  • jQuery
  • jQuery Interview Questions
  • JSON
  • Magento
  • MVC
  • MySQL
  • MySQL Interview Questions
  • OOPS
  • PHP
  • PHP Interview Questions
  • Python
  • Python Interview Questions
  • Reactjs Interview Questions
  • Resume
  • SEO
  • Startups
  • Visual Basic
  • WordPress
  • Wordpress Tutorial

Resources

  • Home
  • Paid Guest Post
  • About
  • Contact
  • Privacy Policy
  • DCMA
  • Home
  • Paid Guest Post
  • About
  • Contact
  • Privacy Policy
  • DCMA

Copyright © 2023 Interview Shortout.

Theme: Oceanly by ScriptsTown

Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}