×

Top 29 Phalcon Framework Interview Questions for 2024

1) What is Phalcon?

Phalcon is an open source framework based on the MVC (Model-View-Controller) pattern. It is the combination of PHP and C language. It is developed by Andres Gutierrez and his group of collaborators.

2) Which language supports Phalcon Framework?

Phalcon Framework supports two language that are : C & PHP.

3) What is the initial date of Phalcon framework?

Initial date of Phylcon framework is: 14 November 2012.

4) What are the features of Phalcon Framework?

Phalcon Framework features are:
  • Low overhead
  • MVC & HMVC Pattern
  • Dependency Injection
  • Support for Rest
  • Autoloader
  • Router

5) Explain directory structure of Phalcon Framework ?

Phalcon Framework directory structure are given below:
  • App
    • Config
    • Controllers
    • Library
    • Migrations
    • Models
    • Views
  • Cache
  • Public
    • Css
    • files
    • img
    • js
    • temp
  • .htaccess
  • .htaccess
  • .htrouter.php
  • index.html

6) What are database related functions in Phalcon?

In Phalcon, database related functions are:
  • find()
  • findFirst()
  • query()
  • findFirstBy etc.

7) What are database engines supported by Phalcon?

Phalcon supported PDO_ database engines that are:
  • Phalcon\Db\Adapter\Pdo\Mysql : Mysql
  • Phalcon\Db\Adapter\Pdo\Postgresql : Postgresql
  • Phalcon\Db\Adapter\Pdo\Sqlite : Sqlite

8) What is zephir in Phalcon ?

Zephir stands for Ze(nd Engine) Ph(p) I(nt)r(mediate) . It is a high level language. It is used for creation and maintainability of extensions for PHP. It exported to C code that can be compiled and optimized by major C compilers such as gcc/clang/vc++.

9) What are the various type of application events in Phalcon?

In Phalcon, there are various tyes of application event :
Event Name Triggered
boot Executed when the application handles its first request
beforeStartModule Before initialize a module, only when modules are registered
afterStartModule After initialize a module, only when modules are registered
beforeHandleRequest Before execute the dispatch loop
afterHandleRequest After execute the dispatch loop

10) How can we pass data from conroller to view in Phalcon ?

In Phalcon, we can pass data from controller to view by setVar() method.
$this->view->setVar("username", $user->username);

11) How can we increase csrf timeout in Phalcon ?

In Phalcon, we can increase csrf (Cross-Site Request Forgery) timeout by increase the token time because tokens default uses sessions.

12) Which template engine Phalcon Use ?

Phalcon uses a Volt template engine.

13) How can we inject services into a Volt template?

We can inject services into a Volt template by using following code:
{# Inject the 'flash' service #}  
<div id="messages">{{ flash.output() }}</div>  
{# Inject the 'security' service #}

14) What is PHQL in Phalcon Framework?

In Phalcon Framework, PHQL stands for Phalcon Query Language, It allows to write queries by using a standardized SQL-like language.

15) How can we read, write and delete sessions in Phalcon?

In Phalcon, we can read, write and delete sessions by using following code:
Creating session: $this->session->set("user-name", "Michael");

Reading or Retriving session: $this->session->get("user-name");

Deleting or Removing session: $this->session->remove("user-name");

16) What are the differences between Phalcon and other framework?

There are various differences between Phalcon and other framework:
Framework Yii Laravel Phalcon
Type of Project It helps to creating large projects It is used to create Web application. It is used to design variety of projects.
Database support It supports relational and non relational db It supports relational DB. It supports both relational and non relational db
Language It is purely written in PHP It is written in PHP and follow MVC pattern. It is written in PHP and C language.
Scalability It is quit scalable. Scalability is high Good for medium projects.
Performance Comparatively low High but less in compare to Phalcon High Performance

17) Does Phalcon support multiple web server?

Yes, Phalcon supports multiple web server.

18) What are the features of a controller?

There are following features of a controller.
  • It helps to update the model's state by sending command to the model.
  • It is also used to send command to the associated view.
  • It acts as an intermediary between the model and the view.

19) How many type of views in Phalcon?

In Phalcon, there are two type of views:
  • .Volt
  • .Phtml

20) What are the differences between .volt and .phtml files?

There are various differences between .volt and .phtml that are given below in table:
.volt .phtml
It is used when the template engine set up. It is used when the template engine is PHP itself.
It can be used as a stand-alone component. It cannot be used as a stand-alone component.
Volt views are compiled to PHP code. It includes PHP volt so there is no need of compilation in Phalcon framework.

21) What are the different type of HTTP methods?

There are various different type of HTTP methods:
  • GET : It is used to retrieve and search data.
  • POST: It is used to add data.
  • PUT : It is used to update data.
  • DELETE: It is used to delete data.

22) How can we declare variable in Phalcon?

In Phalcon, we can declare variable by using set. Example:
1. {% set fruits = ['Apple', 'Banana', 'Orange'] %} // array declare      

   

2. {% set name = "John Kennedy" %}  // string declare

23) Does Phalcon support multiple Databases?

Yes, Phalcon supports multiple Databases.

24) at is PHQL in Phalcon?

In Phalcon, PHQL stands for Phalcon Query Language. It is a high-level SQL that standardize SQL queries for the database system. Example:
// Instantiate the Query   

$query = new Query(   

   "SELECT * FROM Users",   

   $this->getDI()   

);    

  

// Execute the query returning a result if any   

$cars = $query->execute();

25) What are cookies and its types?

Cookies stores small text files in browser. It is known as browser cookies. Types of cookies are:
  • Session cookies
  • Persistent cookies

26) How can we create a session with a name and value in Phalcon?

The following code is used to create a session with a name and value in Phalcon.
<?php    

class SessionController extends \Phalcon\Mvc\Controller {   

   public function indexAction() {   

      //Define a session variable   

      $this->session->set("user-name", "Omkar");   

        

      //Check if the variable is defined   

      if ($this->session->has("user-name")) {   

         //Retrieve its value   

         $name = $this->session->get("user-name");   

         echo($name);   

      }   

   }   

}

27) What are the difference between SQL and NoSQL?

There are following difference between SQL and NoSQL
SQL NoSQL
It is also termed as Relational Databases (RDBMS). It is called as non-relational or distributed database.
The structure of database is constituted as tables and views. It consists of document based and graph databases.
It includes a predefined schema. It has a dynamic schema.
It is very powerful for defining and manipulating data. It is powerful in maintaining data as collection of documents.

28) Which protocol is used to encrypt the password in Phalcon?

In Phalcon, md5, base64 and sh1 protocol is used to encrypt the password.

29) What is CSRF?

CSRF stands for Cross Site Request Forgery. It is an attack which forces authenticated user of web applications. It performs certain unwanted action.

Related Topics

Top 28 Scala Interview Questions for 2024

1) What is Scala? Scala is a functional and object-oriented programming language. It is used to develop web application, mobile application, enterprise application, desktop based application etc. Everything in Scala is in object...

4 minutes read.

PhoneGap Interview Questions 2024

Top 50 Phonegap Interview Questions with their Answers Once you have acquired practical knowledge of the PhoneGap technology, you will now be able to search for a job as a mobile...

9 minutes read.

Top 15 Electron Interview Question for 2024

1) What is Electron? Electron is an open source library developed by Github. It is used to develop cross platform desktop application. 2) Which technology Electron uses? Electron uses Chromium and Node.js with...

3 minutes read.

Top 32 Laravel Interview Questions for 2024

1) What is Laravel? Laravel is an open source PHP framework. It is used to design and develop web applications. It is based on MVC (Model-View-Controller) design pattern. It is created by Taylor...

6 minutes read.

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 15 JSP Interview Questions for 2024

1) What is JSP? It is a technology which is used to create web application like Servlet technology. It provides more functionality than Servlet. It consists of HTML and JSP tags. 2) What are...

3 minutes read.

Top 15 XML Interview Questions for 2024

1) What is XML? XML (eXtensible Markup Language) is designed to transport and store data. It has user executive tags i.e. no pre-defined tags used as in HTML. This language is...

2 minutes read.

Top 10 WCF Interview Questions for 2024

  1. What is WCF? Windows Communication Foundation (WCF), earlier known by the name Indigo, is a run-time platform and a set of APIs in the .NET Framework for building, configuring, and...

7 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 31 Koa Interview Questions for 2024

1) What is Koa? Koa is a very small framework which provides us a minimal interface to build our applications. It is quite flexible and there are numerous modules available on...

4 minutes read.

Artificial Neural Network Interview Questions

1. Explain Neural Network?  Neural Network is a sequence of an algorithm that gives its best to recognize the underlying relationship in a data-set through a process. The artificial neural network...

8 minutes read.

Top 16 Moo Tools Interview Questions for 2024

1) What is Moo Tools? MooTools stands for My Object-Oriented Tools. It is a lightweight and object-oriented JavaScript framework. It is used to create dynamic web page. It is developed by Valerio...

5 minutes read.

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 10 GWT Interview Questions for 2024

1) What is Google Web Toolkit (GWT)? GWT (Google Web Toolkit) is a development toolkit. It is used to develop Ajax web applications using Java. GWT compiler translates Java sour ce...

2 minutes read.

Top 40 IoT Interview Questions and Answers in 2024

Q.1 What is IoT? IoT stands for the Internet of things refers to the interconnection of the network of various devices that can recognize, collect and transfer data over the internet...

13 minutes read.

Top 28 LISP Interview Questions for 2024

1) What is LISP? LISP is the high-level programming language after Fortran. LISP is stands for List Processing. This programming language was invented by John McCarthy in 1958 at the Massachusetts Institute of...

3 minutes read.

Top 15 CherryPy Interview Questions for 2024

1) What is CherryPy? CherryPy is a web framework used for Python. It provides a friendly interface for Http protocol for Python developer. 2) Why we use CherryPy? CherryPy has following strength: Simplicity: It...

3 minutes read.

Top 15 AWS Interview Questions for 2024

1) What is AWS? AWS stands for Amazon Web Services. It is a cloud web hosting platform that offers flexible, scalable, reliable, easy-to-use, and cost-effective solutions. 2) What is Cloud Computing? It is...

2 minutes read.

Top 31 Dart Programming Interview Questions for 2024

1) What is Dart? Dart is an application programming language. It is used to build web, server and mobile applications. 2) Who is the developer of Dart? Google is the developer of Dart. 3)...

6 minutes read.

Top 50 ReactJS Interview Questions for 2024

Top 50 Frequently asked ReactJS Interview Questions Q-1. What is React? Ans-1 React is a front-end JavaScript library which is developed by Facebook in 2011. It follows the component-based approach and allows us to...

15 minutes read.