Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions C++ Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions F# Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions

Top 29 Phalcon Framework Interview Questions for 2022

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, md5base64 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.



ADVERTISEMENT
ADVERTISEMENT