Friends

PHP Interview Questions - II

6. What is meant by MVC (Model View Controller)?
MODEL VIEW CONTROLLER, is a software architecture, currently considered an architectural pattern used in software engineering.
This isolates business logic from presentation logic.
1. The Model represents the application data
2. The View renders a presentation of model data
3. The Controller handles and routes requests made by the client

7.What will be the answer of the following code snippet?

1echo 'Testing ' . 1 + 2 . '45';

Simply you will give the answer as : Testing 345 But the answer is : 245.That is because you can not sum a number with a string. The first part, before the plus mark is a string though there is 1 there. So engine will simply get it as 0 and the latter part as 245. so answer will be 245.

8. What is taxonomy in Drupal ?
We can define any number of vocabularies (category types) and terms (categories). We can config which content types are compatible with which vocabulary and which nodes are belong to which terms. Some important drupal modules: Views, CCK, Path auto, FCK Editor, User points, Flags, Panels, Image cache Views can be used to generate lists of content in various formats. Block is a section in a page (recent posts, news, vote to something, login box, navigation), which is movable to regions (header, footer, content top etc) in a page. Blocks can be configured to show/hide only to certain type of user roles, url patterns or some other advanced criteria.
9.How we can define custom content types? We can install CCK (Content construction kit) module and create content types. We can define the structure of each content type too. 10.What is a node in Drupal? A node is a unit of content. It has a type. Page, News or as Testimonial.


11. What is the difference between  $this  and  self ?

Inside a class definition, $this refers to the current object, while  self  refers to the current class.
It is necessary to refer to a class element using  self , and refer to an object element using  $this .




Next set of questions coming soon.... stay tune..


1 comments:

Nice question and answers!! Post if you have more.

Twitter Delicious Facebook Digg Stumbleupon Favorites More