YouTube Icon

Interview Questions.

Top 100+ Yii Interview Questions And Answers - May 13, 2020

fluid

Top 100+ Yii Interview Questions And Answers

Question 1. What Is Yii Framework? 

Answer : 

Yii is a superior segment based PHP system best for Web 2.0 turn of events. 

Question 2. What Yii Is So Fast? 

Answer : 

Yii is so a lot quicker in light of the fact that it is utilizing the apathetic stacking strategy widely. For instance, it does exclude a class record until the class is utilized just because; and it doesn't make an item until the article is gotten to just because. Different systems experience the ill effects of the presentation hit since they would empower a usefulness (for example DB association, client meeting) regardless of it is utilized or not during a solicitation. 

PHP Interview Questions 

Question 3. Would you be able to Remember What Is Directory Structure When You Downloaded Yii? 

Answer : 

backend/ 

normal/ 

segments/ 

config/ 

params.php 

params-local.php * 

lib/ 

Pear/ 

yii/ 

Zend/ 

relocations/ 

models/ 

Comment.php 

Extension.php 

... 

reassure/ 

orders/ 

SitemapCommand.php 

... 

config/ 

main.php 

fundamental local.php * 

params.php 

params-local.php * 

runtime/ 

yiic.php * 

frontend/ 

segments/ 

config/ 

main.php 

fundamental local.php * 

params.php 

params-local.php * 

controllers/ 

SiteController.php 

... 

lib/ 

models/ 

ContactForm.php 

SearchForm.php 

runtime/ 

sees/ 

designs/ 

site/ 

www/ 

resources/ 

css/ 

js/ 

index.php * 

yiic 

yiic.bat 

Question 4. What Is The First File That Gets Loaded When You Run An Application Using Yii? 

Answer : 

index.php 

PHP Tutorial 

Question 5. What Is Model,view,controller? 

Answer : 

Models speak to the fundamental information structure of a Web application. Models are frequently shared among various sub-utilizations of a Web application. For instance, a LoginForm model might be utilized by both the front end and the back finish of an application; a News model might be utilized by the comfort orders, Web APIs, and the front/back finish of an application. In this way, models 

ought to contain properties to speak to explicit information; 

ought to contain business rationale (for example approval rules) to guarantee the spoke to information satisfies the structure necessity; 

may contain code for controlling information. For instance, a SearchForm model, other than speaking to the hunt input information, may contain an inquiry technique to execute the real pursuit. 

Perspectives are liable for introducing models in the organization that end clients want. When all is said in done, sees 

ought to basically contain presentational code, for example, HTML, and basic PHP code to cross, arrangement and render information; 

ought to abstain from containing code that performs express DB inquiries. Such code is better positioned in models. 

ought to stay away from direct access to $_GET, $_POST, or other comparable factors that speak to the end client demand. This is the controller's activity. The view ought to be centered around the presentation and design of the information gave to it by the controller as well as model, however not endeavoring to get to demand factors or the database straightforwardly. 

may get to properties and techniques for controllers and models legitimately. Be that as it may, this ought to be done distinctly with the end goal of introduction. 

Controllers are the paste that ties models, sees and different parts together into a runnable application. Controllers are liable for managing end client demands. Consequently, controllers 

may get to $_GET, $_POST and other PHP factors that speak to client demands; 

may make model cases and deal with their life cycles. For instance, in a run of the mill model update activity, the controller may initially make the model case; at that point populate the model with the client input from$_POST; subsequent to sparing the model effectively, the controller may divert the client program to the model detail page. Note that the real usage of sparing a model ought to be situated in the model rather than the controller. 

ought to abstain from containing installed SQL proclamations, which are better kept in models. 

ought to abstain from containing any HTML or some other presentational markup. This is better kept in sees. 

Zend Interview Questions 

Question 6. What Is The Naming Convention Inyii? 

Answer : 

You can characterize table prefix when utilizing Gii. For your situation you have to set it to tbl_. At that point it ought to create UserController rather than TblUserController. 

The Yii Framework utilizes a class naming show whereby the names of the classes straightforwardly guide to the catalogs in which they are put away. The root level registry of the Yii Framework is the "structure/" catalog, under which all classes are put away progressively. 

Class names may just contain alphanumeric characters. Numbers are allowed in class names yet are disheartened. Spot (.) is just allowed instead of the way separator. 

Question 7. What Is The Component,helper And Why Are They Used,is There Other Way We Can Do Same Thing,what Is Better? 

Answer : 

A part is an autonomous bit of code composed for explicit assignment that can be utilized by bringing in controllers (model : email segment), partner is utilized for aiding yii in rendering the information to be appeared to client with sees, these lone adds to seclusion in code in any case same coding can be executed in controllers. 

Zend Tutorial PHP and Jquery Interview Questions 

Question 8. How Do You Proceed When You Have To Use Yii For Any Application? 

Answer : 

take the structure either from Yii site or on the off chance that you have changed by your requirements start from that point. Continue with fundamental programming engg. ideas as necessity gathering and so forth.. 

This is an essential Understanding Concept in yii 

Yii-based applications are driven by information rationale. At the point when I construct an application, I generally start by ensuring that my database plans are very much structured and enhanced to fit the business stream of the application. In this manner, my codes are consequently produced dependent on my database structure. Also, yes… 

… Yii can create everything of PHP codes for you consequently! Simply characterize which database you need to utilize, and with a couple of snaps it will make a CRUD (make read-update-erase) application for you. It looks so adorable, I let you know! Talking about programmed… 

… Yii can create a skeleton application for you naturally. This skeleton application incorporate a view page, a login page, contact page and fundamental route, all wrapped inside a totally sorted out envelope tree dependent on the standard MVC programming model. 

The broad decision of Yii capacities bodes well. As a self-educated web developer, I had the option to delineate its capacities to the entirety of the RESPONSE and REQUEST undertakings I frequently use when building webapps inside only minutes. It additionally doesn't hurt that the Yii people group has generously given cheat sheets to the capacities so I can do a speedy reference when I have to. 

The Definitive Guide to Yii report that accompanies the Yii introduce is quite simple to experience, in any event for me. I don't have the foggiest idea why, however. I thought CakePHP docs were more easy to understand and alluring, however shockingly I had the option to experience Yii documentation and instructional exercise in only two hours and not get cross-peered toward before its finish. 

Yii utilizes MySQL and SQLite as its decision database types. Obviously, you can run some other kind of databases as long as you have its PDO empowered in your php.ini record. I create utilizing MySQL more often than not, yet my affection for SQLite is expanding, because of the way that SQLite is so darn lightweight and simple to utilize. 

Yii is coordinated with jQuery, which implies that a significant number of the vital approval capacities I use can without much of a stretch be stopped inside the Yii work calls itself, which is normally just a line of code or two. 

Yii is open-source, and it's free. Open-source items turn me on. 

Question 9. What Is The First Function That Gets Loaded From A Controller? 

Answer : 

list 

PHP+MySQL Interview Questions 

Question 10. What Is Habtm? 

Answer : 

HasAndBelongsToMany 

has and has a place with many is a sort of affiliations that can be characterized in models for recovering related information across various elements 

PHP and Jquery Tutorial 

Question 11. How Might We Use Ajax In Yii? 

Answer : 

by calling ajax assistant and afterward utilizing it in controller for rendering. 

Sybase Interview Questions 

Question 12. In the event that You Have To Validate A Registrations Module For A User, What All Can Be Possible Ways, Which One Is The Best? 

Answer : 

should be possible on accommodation in controller, or utilizing javascript/ajax while client is as yet filling the information. Subsequent choice is better. 

PHP Interview Questions 

Question 13. Would you be able to List Some Database Related Functions In Yii? 

Answer : 

discover, findAll , findByPk , find By ,inquiry 

Magento Tutorial 

Question 14. How Might You Include A Javascript Menu Throught The Site? Give Steps? 

Answer : 

By including the javascript documents in webroot and call them in default sees if necessary all over the place or just in the related perspectives. 

Question 15. Step by step instructions to Install Or Setup Yii-structure In Your Local System ? 

Answer : 

To introduce Yii you have to 

Download the Yii code from its official site or github. 

Concentrate the code into your server root index. 

Open order line terminal and type the accompanying order. 

php way to-yii-organizer/system/yiic webapp [webapp-name] 

After execution of above order , it will approach you for the affirmation of making your application , on choosing yes , this will make a defaut application. 

Dbase Interview Questions

Question 16. The most effective method to Configure Yii Aplication With Database ? 

Answer : 

In default use of yii, open the main.php record exists in ensured/config/main.php and scan for a parameter named as db, there you can include have name, database name , username and secret key of your database server. 

WordPress Tutorial 

Question 17. How You Can Create And Work With Different Module In Yii ? 

Answer : 

To make a module get to gii url and there you can make a module. in the wake of making a module from gii you have to include it the mai design record of your yii application. 

localhost/your-application/index.php?r=gii/utl to get to gii 

.... 

'modules' => cluster( 

'module-name', 

'other-module', 

'client' => cluster( 

'activeAfterRegister' => bogus, 

), 

..... 

Magento Interview Questions 

Question 18. What Is "gii" And Why It Is Used ? 

Answer : 

Gii is a module that gives Web-based code age capacities. To work with gii, you have to change the fundamental design record of your application like after. 

bring exhibit back( 

...... 

'modules'=>array( 

'gii'=>array( 

'class'=>'system.gii.GiiModule', 

'password'=>[*choose a password*] 

), 

), 

To get to gii in your nearby framework, hit the url on your program localhost/your-application/index.php?r=gii. You have to type the secret phrase that you have set in the principle setup of your application. to continue further. 

Zend Interview Questions 

Question 19. How You Can Remove Index.php From Your Application Url ? 

Answer : 

Steps to expel index.php from your application url. 

Stage 1: First arrange your Yii-application setup record like beneath code 

..... 

'urlManager'=>array( 

'urlFormat'=>'path',/required 

'showScriptName'=>false,/required 

'urlSuffix'=>'.html',/not required 

...... 

), 

.... 

Stage 2: Enable apache revamp motor. To empower rework motor sort the accompanying order in your terminal (Ubuntu ). 

a2enmod revamp/to empower rework motor 

#Restart apache2 after 

/and so on/init.d/apache2 restart 

Or on the other hand 

administration apache2 restart 

Stage 3: Then, in the event that you'd like, you can utilize the accompanying .htaccess record in your application envelope where index.php exists 

RewriteEngine On 

RewriteBase/ 

RewriteCond %{REQUEST_FILENAME} !- f 

RewriteCond %{REQUEST_FILENAME} !- d 

RewriteRule . /index.php [L] 

That is all the 3 stages to expel index.php from the URL. 

CakePHP Tutorial 

Question 20. What Is The Difference Between "render" And "renderpartial" ? 

Answer : 

render() is regularly used to render a view that relates to what a client sees as a "page" in your application. It first renders the view you have determined and afterward renders the format for the present controller activity (if material), setting the consequence of the primary render into the design. It at that point performs yield handling (which as of now implies consequently embeddings any essential <script> labels and refreshing powerful substance) lastly yields the outcome. 

renderPartial() is generally used to render a "piece" of a page/HTML. The principle contrast from render() is that this strategy doesn't put the consequences of the render in a design.




CFG