currentPage()

Returns the current page's PageReference.

Signature

public System.PageReference currentPage()

Return Value

Type: System.PageReference

Example

This code segment returns the id parameter of the current page.

public MyController() {
    account = [
        SELECT Id, Name, Site 
        FROM Account 
        WHERE Id =
            :ApexPages.currentPage().
             getParameters().
             get('id')
    ];
}
Previous
Next