CRM_Core_Page
class CRM_Core_Page
A Page is basically data in a nice pretty format.
Pages should not have any form actions / elements in them. If they do, make sure you use CRM_Core_Form and the related structures. You can embed simple forms in Page and do your own form handling.
Properties
protected string | $_name | The name of the page (auto generated from class name) | |
protected object | $_title | The title associated with this page. | |
protected int | $_mode | A page can have multiple modes. (i.e. displays a different set of data based on the input | |
protected bool | $_embedded | Is this object being embedded in another object. If so the display routine needs to not do any work. (The parent object takes care of the display) | |
protected bool | $_print | Are we in print mode? if so we need to modify the display functionality to do a minimal display :) | |
static protected CRM_Core_Smarty | $_template | Cache the smarty template for efficiency reasons | |
static protected CRM_Core_Session | $_session | Cache the session for efficiency reasons | |
array | $ajaxResponse | What to return to the client if in ajax mode (snippet=json) | |
array | $urlPath | Url path used to reach this page | |
bool | $useLivePageJS | Should crm.livePage.js be added to the page? |
Methods
Class constructor.
This function takes care of all the things common to all pages.
Store the variable with the value in the form scope.
Get the variable from the form scope.
Assign value to name in template.
Assign value to name in template by reference.
Appends values to template variables.
Returns an array containing template variables.
Destroy all the session state of this page.
Use the form name to create the tpl file name.
A wrapper for getTemplateFileName that includes calling the hook to prevent us from having to copy & paste the logic of calling the hook
Default extra tpl file basically just replaces .tpl with .extra.tpl i.e. we dont override
Setter for embedded.
Getter for embedded.
Setter for print.
Getter for print.
No description
No description
No description
Assign metadata about fields to the template.
Details
at line 126
CRM_Core_Page
__construct(string $title = NULL, int $mode = NULL)
Class constructor.
at line 166
run()
This function takes care of all the things common to all pages.
This typically involves assigning the appropriate smarty variables :)
at line 249
set(string|array $name, mixed $value = NULL)
Store the variable with the value in the form scope.
at line 260
mixed
get(string $name)
Get the variable from the form scope.
at line 271
assign(string $var, mixed $value = NULL)
Assign value to name in template.
at line 282
assign_by_ref(string $var, mixed $value)
Assign value to name in template by reference.
at line 294
append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)
Appends values to template variables.
at line 305
array
get_template_vars(string $name = NULL)
Returns an array containing template variables.
at line 312
reset()
Destroy all the session state of this page.
at line 321
string
getTemplateFileName()
Use the form name to create the tpl file name.
at line 335
getHookedTemplateFileName()
A wrapper for getTemplateFileName that includes calling the hook to prevent us from having to copy & paste the logic of calling the hook
at line 347
string
overrideExtraTemplateFileName()
Default extra tpl file basically just replaces .tpl with .extra.tpl i.e. we dont override
at line 356
setEmbedded(bool $embedded)
Setter for embedded.
at line 366
bool
getEmbedded()
Getter for embedded.
at line 375
setPrint(bool $print)
Setter for print.
at line 385
bool
getPrint()
Getter for print.
at line 392
static CRM_Core_Smarty
getTemplate()
at line 401
null
getVar(string $name)
at line 409
setVar(string $name, $value)
at line 426
protected
assignFieldMetadataToTemplate(string $entity)
Assign metadata about fields to the template.
In order to allow the template to format fields we assign information about them to the template.
At this stage only date field metadata is assigned as that is the only use-case in play and we don't want to assign a lot of unneeded data.