+ Start a Discussion
Mecrin Luvis 1Mecrin Luvis 1 

Controller

Hi guys,

Types of the controller!!!! and their functionality!!!
Koustubh KulkarniKoustubh Kulkarni
When coming to visualforce controllers in force.com development there are three types of controllers. They are
1)Standard Controllers.
2)Custom Controllers.
3)Controller extensions.
Standard Controllers :- Standard controllers are the default Controller’s provided by Force.com. These standard controllers will have same logic and functionality used standard visualforce pages. No Apex code is required in Standard Controllers

Syntax :- <apex:page standardcontroller =”contact”></apex:page>

Custom controller :- When a developer needs different logic and functionality he/she may write their own Apex controller class. Custom controller’s will not provide default functions like standard controllers. Custom apex code must be written for custom controllers.

Syntax :- <apex : page controller = “Mycontroller”></apex:page>

Extension controllers :-If we want to use both custom controller functionality and standard controller functionality we use extension controllers. Extension Controllers begins with Standard controller and extended or overridden with custom controller with custom apex code.

Syntax :- <apex:page standardcontroller = “contact” extensions = “Testclass1, Testclass2″></apex:page>

you can also refer these links-
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller.htm
http://salesforce.stackexchange.com/questions/4041/difference-between-controller-and-extensions

If you find this answer helpfull, then mark it as Best.