InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
How to create a validation object in FuelPHP? |
|
Answer» 1. Create an object. 2. INSTANTIATE it, $val = Validation::forge('my_validation'); 3. Start adding fields to it, $val = Validation::forge('my_validation'); 4. ADD username to it, $val->add('username', 'Your username')->add_rule; 5. Add COLUMN for PASSWORD, $val->add('password', 'Your password') ->add_rule('required') ->add_rule('min_length', 3) ->add_rule('max_length', 10); (The digits are as per the requirements) 6. Add the next field, the gender field- $val->add('gender', 'Your gender')- >add_rule('required') ->add_rule('match_collection', array('M', 'F')); If any other validations are to be given, then give them using add_rule() method. Or Forge ( ) method is used for creating a validating objects, such as $val= Validation:: forge( ); |
|
| 52. |
What is Scaffolding in FuelPHP? |
|
Answer» The TERM Scaffolding is a meta-data programming method NEEDED for building database operations. The scaffolding of the concept FuelPHP which makes the work easy and helpful in allowing to get a basic CRUD APPLICATION that too FOLLOWING simple and easy STEPS. It is one of the common FuelPHP Interview Questions. |
|
| 53. |
How to write the select query in FuelPHP Framework? |
| Answer» | |
| 54. |
What is Presenter and how we can create Presenter in FuelPHP Framework? |
|
Answer» A CLASS containing LOGIC is called as a presenter. It is useful for generating our view. A presenter can consist of database calls or the RELATED retrievals but not perform any data manipulations. ExampleCreating Presenter is FuelPHP- classPresenter_Index extends Presenter |
|
| 55. |
How to install the FuelPHP Framework? |
|
Answer» 9. EXPLAIN the RESERVED Routes in FUELPHP Framework? There are four reserved routes- |
|
| 56. |
What are the default security features provided by FuelPHP frameworks? |
Answer»
|
|
| 57. |
Lists the minimum requirements for installing the FuelPHP Framework? |
| Answer» | |
| 58. |
What is HMVC in fuelPHP? |
|
Answer» It is a HIERARCHICAL Model-View-Controller FRAMEWORK used in FuelPHP providing the permission of requesting the internal controllers from the applications. It is a direct extension to the MVC pattern which HELPS in managing all the pre-defined SCALABILITY ISSUES. |
|
| 59. |
What are the template engines supported by FuelPHP Framework? |
Answer»
Interesting, RIGHT? Read on to KNOW more FuelPHP INTERVIEW QUESTIONS. |
|
| 60. |
List some advantages and disadvantages of FuelPHP? |
Answer»
|
|
| 61. |
Name the current Stable version of FuelPHP |
|
Answer» In the YEAR 2018, the updated version of FuelPHP, 1.8.1 was released. It CONTAINS improved FUNCTIONALITIES, fixes the bugs, and SEVERAL usual improvements. |
|
| 62. |
What is FuelPHP and why it is used? |
|
Answer» It is a web APPLICATION framework and is an open source platform which WORKS to execute HMVC pattern. The long list of the features of the TECHNOLOGY is the answer to the above question. The main traits which MAKE FUELPHP framework user-friendly are-
|
|
| 63. |
What are Single or Multi-Module Applications in Phalcon? |
|
Answer» Single module applications have only ONE module. This application does not mandate a namespace. It has a structure as – single/ app/ controllers/ models/ views/ public/ css/ img/ js/ Multi-module USES the same document root for all the modules. Each directory in APPS has an MVC structure of its own. Module-specific settings are configured USING Module.php present in each module. The structure is like – multiple/ apps/ frontend/ controllers/ models/ views/ Module.php backend/ controllers/ models/ views/ Module.php public/ css/ img/ js/ |
|
| 64. |
How to declare a variable in Phalcon? |
|
Answer» No need to DECLARE a VARIABLE in PHALCON; the variable is created when its value is ASSIGNED. Example - $name = “user1”; |
|
| 65. |
Explain the differences between .volt and .phtml files? |
Answer»
|
|
| 66. |
Explain the differences between Phalcon and Laravel? |
|||||||||||||||||||||
Answer»
|
||||||||||||||||||||||
| 67. |
How many database engines supported by Phalcon? |
|
Answer» There are 3 database ENGINES supported by Phalcon – Mysql, POSTGRESQL, and SQLITE. |
|
| 68. |
How can you pass data from the controller to view in Phalcon? |
|
Answer» You can use setVar() or setVars() in the CONTROLLER’s showAction() method to PASS SINGLE or multiple variables respectively, DIRECTLY to the view.
Instead of using the above methods, you can also set the variables as $this->view->username = $user->username; |
|
| 69. |
How to inject services into a Volt Template in Phalcon? |
|
Answer» There are 2 ways to inject services into Volt -
|
|
| 70. |
Which template engine is used in Phalcon? Explain |
|
Answer» Volt is the template engine USED in Phalcon. It is fast and designer-friendly. Volt VIEWS are COMPILED in php and have many helpers that make writing views easier and QUICKER. |
|
| 71. |
What is Lazy Initialization in Phalcon? |
|
Answer» Lazy INITIALIZATION is a technique where a class is automatically LOADED by the Phalcon class ‘Loader’ during RUNTIME. This greatly improves performance. Auto loader does this in 4 ways i.e. by registering
and then registering the auto loader as $loader->register(); |
|
| 72. |
How to use session in Phalcon? |
|
Answer» To initiate new session,
setting data into session RETRIEVE session data
removing session
|
|
| 73. |
Please explain Phalcon Routing? |
|
Answer» In Phalcon, routing is managed by its Router component. This component allows the USER to define and add custom ROUTES that can be mapped to CONTROLLERS or handlers that RECEIVE the requests from the application. The router parses the incoming URI BASED on the information received. |
|
| 74. |
Please explain dependency injection in Phalcon? |
|
Answer» Dependency Injection (DI) is a pattern through which appropriate objects or instances of a class are created during run-time rather than compile-time. The class, thus, becomes independent from creating the cases and it is the responsibility of DI to know which class requires what objects and provide the same. In Phalcon, the DI COMPONENT IMPLEMENTS dependency injection and manages the global instances of DIFFERENT classes used in the application. |
|
| 75. |
What is ODM in Phalcon? |
|
Answer» ODM or OBJECT-Document-Mapping is the mapping for NOSQL databases. Phalcon can MAP documents from NoSQL databases through ODM using a UNIQUE ObjectID for each object to be mapped. Phalcon’s ODM offers CRUD functionality, events, validation, and other services. The advantage of ODM is that it is a persistence mechanism where an application model and data SOURCE have no dependencies on each other. |
|
| 76. |
How to increase the CSRF timeout in Phalcon? |
|
Answer» In Phalcon, we can INCREASE CSRF (Cross-Site REQUEST Forgery) timeout by INCREASING the token time as tokens maintain the user sessions. Token time is valid until the session is valid. The session time can be increased by setting session.gc_maxlifetime to a HIGHER value in the php.ini file. |
|
| 77. |
What is PHQL in Phalcon? |
|
Answer» PHQL is a HIGH-level, object-oriented QUERY LANGUAGE similar to SQL. Phalcon provides a parser written in C that translates syntax into RDBMS. This in-memory parser uses the same technology as SQLite, which is thread-safe, prevents SQL INJECTION and consumes very less memory, thus giving high PERFORMANCE. |
|
| 78. |
Explain the features of Phalcon? |
|
Answer» Following are the unique features of Phalcon –
|
|
| 79. |
What is Phalcon and why it is used? |
|
Answer» Phalcon is a full-stack open source framework written in PHP and C (programming LANGUAGES). It is the first framework that implements object-relational-mapping (ORM) in C. This loosely coupled framework is based on MVC (model-view-controller) architecture. Phalcon runs on PHP 5.4 and is one of the fastest FRAMEWORKS. Phalcon can be used for end to end web applications that
|
|
| 80. |
How to create Controllers's Action in Symfony2? |
|
Answer» In your CREATED controller you can CREATE your action with the FOLLOWING code.Example public function indexAction() |
|
| 81. |
How to create pages in Symfony2? |
| Answer» | |
| 82. |
Symfony support which template engine? |
|
Answer» Symfony SUPPORTS default TEMPLATE ENGINE is Twig, but ever, you are free to use PLAIN PHP code if you WANT. |
|
| 83. |
How to get the parameters from URL's in symfony2? |
|
Answer» $REQUEST = $this->CONTAINER->GET('request'); |
|
| 84. |
How to get current route name in Symfony? |
|
Answer» $requestName = $this->CONTAINER->GET('request'); |
|
| 85. |
How to create Controllers in Symfony2? |
|
Answer» CONTROLLER's file DEFAULT location is src/AppBundle/Controller Now you can CREATE here your controller with below code. ExampleNAMESPACE AppBundle\Controller;
|
|
| 86. |
Please write the steps to install Symfony2 using composer? |
|
Answer» COMPOSER create-project symfony/framework-standard-edition ProjectName "2.7.*" // You Can MENTION here you particular VERSION that you want to install |
|
| 87. |
Explain the innovations in Symfony2? |
Answer»
|
|
| 88. |
What is Symfony 2 and explain its advantages? |
|
Answer» Symfony2 is embracing high standards. It is CENTERED around HTTP specification and PHP standards. These standards make Symfony2 interoperable with amazing PHP libraries. USING the Dependency Injection (DI) PATTERN, the framework has a built-in DI Container, which MAKES it FLEXIBLE and easy to customize. |
|
| 89. |
How to check an element is exists in array or not in PHP? |
|
Answer» With the help of in_array() function we can check any element is EXISTS in ARRAY or not. It's return type is TRUE when element is exists and false when an element is not exists in array. Syntaxin_array(SEARCH,array,type) Example$array = array("Best", "Interview", "Questions"); |
|
| 90. |
How to check a variable is an array or not in PHP? |
|
Answer» PHP developers use the is_array() function to determine WHETHER a variable is an array or not. It is AVAILABLE for only PHP 4 and above versions. Exampleis_array (var_name) |
|
| 91. |
How to find the index of an element in an array PHP? |
| Answer» | |
| 92. |
What is the difference between mysql and mysqli? |
||||||||||||||
Answer»
Note: PHP’s easy to learn algorithm combined with its data semantics makes it a very high-functioning language. Our LIST of PHP interview questions will help you in understanding the CORE elements of PHP while giving you clarity on the subject. |
|||||||||||||||
| 93. |
What is the use of ctype_upper() in PHP? |
||||||||
|
Answer» The ctype_upper() function in PHP used to check EVERY and each and every personality of a given string is in uppercase or not. If the string in the top case then it RETURNS TRUE otherwise returns False. 99. What are the difference between self and $this in PHP?
|
|||||||||
| 94. |
What is Web Workers in HTML5? |
| Answer» | |
| 95. |
What are the __construct() and __destruct() methods in a PHP class? |
|
Answer» Constructor and a Destructor both are special functions which are automatically called when an object is created and destroyed. Exampleclass Animal |
|
| 96. |
Explain the difference between mysql_fetch_array(), mysql_fetch_object()? |
|
Answer» 1. mysql_fetch_object: It RETURNS the RESULT from the database as objects. In this field can be accessed as $result->NAME 2. mysql_fetch_array: It returns result as an array. In this field can be accessed as $result->[name] |
|
| 97. |
Please explain the difference between isset() and empty()? |
|
Answer» 1. isset(): It returns TRUE if the variable EXISTS and has a value other than NULL. It means variables assigned a "", 0, "0", or FALSE are set. 2. EMPTY(): It checks to SEE if a variable is empty. It INTERPRETED as: "" (an empty string). isset($var) && !empty($var) will be equals to !empty($var) |
|
| 98. |
What is the use of nl2br() in PHP? |
|
Answer» It is used to inserts HTML LINE BREAKS ( <BR /> or <br /> ) in front of each NEWLINE (\N) in a string. |
|
| 99. |
What is substr() in PHP? and how it is used? |
|
Answer» It is used to extract a part of the string. It allows THREE parameters or arguments out of which two are mandatory, and one is optional echo substr("Hello world",6); It will return first six characters from a given string. 92. What the use of var_dump()?It is used to DUMP information about one or more VARIABLES. It displays structured data such as the type and value of the given variable. Example: $var_name1=12; int(12); |
|
| 100. |
What is str_replace()? |
|
Answer» It is USED to replaces some CHARACTERS with some other characters in a string. Suppose, we want to Replace the characters "Umesh" in the string "Umesh Singh" with "SONU" ECHO str_replace("Umesh","Sonu","Umesh Singh"); |
|