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.
| 501. |
What are the server requirements to install Yii2? |
|
Answer» To install the Yii FRAMEWORK, your SERVER requires PHP 5.4 or higher VERSION, mbstring EXTENSION, and PCRE-support |
|
| 502. |
How we can get current controller & action name in Yii? |
|
Answer» You can get the current CONTROLLER NAME by: |
|
| 503. |
How we can call layouts in controller file in Yii? |
| Answer» | |
| 504. |
What is gii? Why it is used? |
|
Answer» Gii is one of the most POWERFUL web-based, code-generator MODULES in the Yii Framework. It HELPS the DEVELOPERS in creating fully-customized forms and models for databases. |
|
| 505. |
What is the difference between render() and renderpartial() in Yii ? |
||||||||||||
Answer»
To get the IP address of a user within the Yii Framework, the following code can be used: This information was frequently ASKED during Yii interview questions for experienced professionals. |
|||||||||||||
| 506. |
How we can remove index.php from URL in Yii? |
| Answer» | |
| 507. |
How to include a view file in another view file Yii? |
| Answer» | |
| 508. |
How to make layout in Yii? |
| Answer» | |
| 509. |
What is helper in Yii? Why it is used? |
|
Answer» The Yii Framework provides many classes that SIMPLIFY COMMON coding tasks like ARRAY MANIPULATION, code generation, etc. These are called HELPER classes. These can be found under yii\helpers. These classes are static, which means they merely contain static methods and should never be instantiated. |
|
| 510. |
What is components in Yii? Explain |
|
Answer» In YII, a component is an independent code written for a particular TASK which can be used by SUMMONING CONTROLLERS. An example of ELEMENTS is an email component. |
|
| 511. |
What is the naming convention in Yii framework? Explain |
|
Answer» Table prefix is defined USING Gii by setting to tbl_. Once you set it, UserController will get generated instead of TblUserController. The Yii Framework INCLUDES a class naming convention in which the NAMES of classes MAP to the directories where they are stored. For your information, “framework/” directory is the root LEVEL directory of Yii that stores all classes hierarchically. Also, in Yii, the class names may contain only alphanumeric characters. Though numbers are allowed but are discouraged. You can use Dot (.) just in place of path separators. |
|
| 512. |
How to connect with database in Yii? |
|
Answer» In any Yii APPLICATION, you need to open the main.php file in the protected/config/main.php folder. Now SEARCH for the "DB" parameter. In this parameter, you can add the DATABASE NAME, hostname, username, and password for your database server. |
|
| 513. |
How to install Yii Framework? |
| Answer» | |
| 514. |
What are the directory structure of Yii? |
| Answer» | |
| 515. |
What are the advantages of YII Framework? |
| Answer» | |
| 516. |
Who developed YII? |
|
Answer» Yii is not developed by a single individual. A strong team of CORE developers and an ONLINE COMMUNITY of professionals has been contributing to this FRAMEWORK's DEVELOPMENT. |
|
| 517. |
What is the latest version of YII? |
|
Answer» YII 2.0 |
|
| 518. |
How to compare yii with other frameworks? Explain |
||||||||||||
Answer»
Reading our VAST question bank will make it easy for you to crack the Yii BASIC interview QUESTIONS. |
|||||||||||||
| 519. |
What is YII? |
|
Answer» Yii is a component-based, high-performance PHP framework for developing extensive Web APPLICATIONS quickly. Yii ENABLES maximum reusability in PROGRAMMING and significantly accelerates the process of web application DEVELOPMENT. |
|
| 520. |
How we can connect multiple databases in CodeIgniter? |
|
Answer» $database1 = $this->LOAD->DATABASE('DB1', TRUE); // Connect with database 1 |
|
| 521. |
How we can redirect a page in CodeIgniter? |
|
Answer» We can USE the redirect() FUNCTION to redirect on any page. Example$this->load->helper('URL'); // FIRSTLY you have to load url helper. |
|
| 522. |
How to enable error log in CodeIgniter? |
|
Answer» Step 1. MAKE /application/logs LOG folder writable |
|
| 523. |
How to truncate table with query in Codelgniter? |
|
Answer» // TRUNCATE table ADMIN; |
|
| 524. |
How to use Pagination in Codelgniter? |
|
Answer» 36. How to use delete query in Codeigniter? You can use $this->db->delete('ADMIN', array('id' => 5)); this query to delete RECORD according to CONDITION |
|
| 525. |
How we can get current method or controller in Codeigniter? |
|
Answer» You can USE this $this->router->fetch_class(); to GET current controller name. |
|
| 526. |
How we can get Ip address in Codeigniter? |
|
Answer» You can USE $this->INPUT->ip_address(); this to get IP Address. |
|
| 527. |
Explain how to set and get config item value in Codeigniter? |
|
Answer» To SET CONFIG VALUE $this->config->set_item('mainURL','bestinterviewquestion.com'); we can use this. To GET config value $this->config->set_item('mainURL'); we can use this. |
|
| 528. |
How to write join query in CodeIgniter? |
|
Answer» $this->DB->JOIN('blog', 'comment.blog_id= blog.id', 'inner'); |
|
| 529. |
How to get last inserted id in codeigniter? |
|
Answer» You can USE $LASTINSERTID = $this->db->insert_id(); after INSERT query. |
|
| 530. |
Explain how to create custom 404 page in CodeIgniter? |
|
Answer» You can create your custom 404 page with these steps. Please follow these steps one by one.
You can use $this->db->insert(); to insert data in your database in Codeigniter. Also Read: SYMFONY interview questionsExampleIf you want to insert this in your "Admin Table". // Here "Admin" is My TableName |
|
| 531. |
How we can print SQL statement in codeigniter model? |
|
Answer» You can USE $this->db->last_query(); to display the QUERY string. |
|
| 532. |
What do you mean by drivers and how we can create in CodeIgniter? |
|
Answer» In CodeIgniter drivers are a very special type of Library that has a parent class and its child CLASSES. Child classes have the ACCESS to its parent class but not their siblings. It provides an elegant syntax in your controllers file for libraries. It can FOUND in the system/libraries/ directory.
|
|
| 533. |
How we can enable hooks in CodeIgniter? |
|
Answer» If you WANT to ENABLE hooks then you have to enabled/disabled by setting in the application/CONFIG/config.php file. If you want to enable hooks then use this $config['enable_hooks'] = TRUE; |
|
| 534. |
How we can load multiple helper files in Codelgniter? |
|
Answer» You have to pass your helpers in array form. Here helper_1, helper_2, helper_3, helper_4 are different helpers that we WANT to LOAD. $this->load->helper( |
|
| 535. |
What are the server requirements to install codeigniter? |
|
Answer» We need only PHP version 5.6 or GREATER than 5.6. because of POTENTIAL security and performance ISSUES. |
|
| 536. |
How to install CodeIgniter? Explain step by step. |
|
Answer» CodeIgniter can be INSTALLED with FOUR steps that are given below:
If you want to CONFIGURE additional setting then you can click here |
|
| 537. |
Explain why codeigniter is called as loosely based mvc framework? |
|
Answer» It is called as loosely BASED mvc framework because in codeigniter controller is the necessary but model and view are OPTIONAL. It means we can build a WEBSITE WITHOUT model. |
|
| 538. |
How to handle sessions in Codeigniter? |
|
Answer» How to add values in session in Codeigniter $_SESSION['username'] = 'bestinterviewquestion.com' // It can be use in core PHP We can pass array to store values in session in Codeigniter. $array = array( $this->session->set_userdata($array); How to remove values in session in Codeigniterunset($_SESSION['username']); // It can be use in core PHP If we WANT to remove more values from session then we can use like this $this->session->unset_userdata($array); // $array is DEFINED above. It is an array with KEY & values. How to get data from session in Codeigniter$this->session->userdata('username'); // Here we will get username, if it is exists in session. |
|
| 539. |
What is Codeigniter Library and how we can load it? |
|
Answer» Codeigniter PROVIDES a rich SET of libraries, which indirectly INCREASE the speed of developing an application. These Codeigniter system library is located in system/libraries. In Codeigniter the library can be LOADED with $this->load->library('class name'); If we WANT to load multiple libraries then we can use like $this->load->library(array('comment', 'blog')); Related Article: Wordpress interview questions |
|
| 540. |
What is CSRF and how you can enable CSRF in CodeIgniter? |
|
Answer» In codeIgniter CSRF token is a random generated value that CHANGES with each HTTP request SENT by webform. When the form is submitted by user then WEBSITE CHECKS this submitted CSRF token equals or not the saved in the session. We can enable CSRF protection from config.php and UPDATE the following values $config['csrf_protection'] = TRUE; |
|
| 541. |
How to remove index.php from URL in Codeigniter? |
|
Answer» You can FOLLOW these given STEPS to remove index.php from URL in Codeigniter.
|
|
| 542. |
What do you mean by inhibitor in CodeIgniter? |
|
Answer» Inhibitor is an error HANDLING CLASS. It is USING the native PHP functions like set_error_handler, set_exception_handler, register_shutdown_function to handle all error's like PARSE errors, exceptions, and fatal errors. |
|
| 543. |
How to link images/CSS/JavaScript from a view in codelgniter? |
|
Answer» We can use an absolute path to RESOURCES to link images/CSS/JavaScript from a view in CodeIgniter. For Example : <link REL = "stylesheet" type = "text/css" HREF = "<?php echo base_url(); ?>css/responsive.css"> |
|
| 544. |
List some different hook point in Codeigniter? |
|
Answer» CODEIGNITER supports various HOOK points.
If you are scrolling on the web for Codeigniter interview questions for 2 year EXPERIENCE pdf, then this GUIDE will gonna HELP you. |
|
| 545. |
What do you mean by routing in Codeigniter? |
|
Answer» It is the process of taking a URI endpoint and decomposing it into parameters to DETERMINE module controller and ACTION of that controller should receive the request.
CODEIGNITER has a USERFRIENDLY URI routing rule so that we can re-route URL easily . There is a one-to-one relationship between a URL string and its corresponding controller class and its methods.
Routing is a technique through which we can converts SEO friendly URLs into a server code format that easily understandable.
We can manage these from routes.php file at the located in application/config. |
|
| 546. |
What do you mean by Get_instance in CodeIgniter? |
|
Answer» It is a globally available METHODS or functions that returns the Controller super-object which contains all the currently loaded CLASSES. get_instance() function returns the Controller CLASS INSTANCE. |
|
| 547. |
Explain the difference between helper and library in CodeIgniter? |
|
Answer» Helper is a set of COMMON FUNCTIONS which we can use within Models, VIEWS, Controllers everywhere. Once we include that file then we can get access to the functions. NOTE : A library is used in object-oriented context but a helper is more SUITABLE to be used within the Views Also READ: Laravel interview questions |
|
| 548. |
What do you mean by helper in CodeIgniter? |
|
Answer» Helpers is collection of functions which help us with different tasks as name suggested. Every helper function is used to performs specific task with no DEPENDENCE on other functions. CodeIgniter provide various types of helper CLASS like url_helper, captcha_helper ,email_helper. All these helpers are located in system/helper. By default CodeIgniter does not load any Helper files. First step is to be load Helper. After loaded it is AVAILABLE in all controller and views.
How we can load a Helper : $this->load->helper('name'); How to load multiple Helpers at ONE time. |
|
| 549. |
Explain the basic Url Structure in Codeigniter? |
|
Answer» The BASIC URL STRUCTURE is bestinterviewquestion.com/class/function/ID. Here class represents controller's class that NEEDS to be invoked. |
|
| 550. |
What is the default controller used in CodeIgniter? How we can change it? |
|
Answer» In CodeIgniter when a specified file in the default controller loaded by default when there is no file name mentioned in URL. By default "welcome.php" file is loaded after installing CodeIgniter. Yes, we can CHANGE it from application/config/routes.php. We have to pass our controller name which we want to LOAD by default in $route['default_controller'] For EXAMPLE, now the frontend is the default controller $route['default_controller'] = 'Frontend'; from now. Interview questions on Codeigniter are always a LEVEL up and thus a little tough to crack. |
|