Retrieve the one-and-only atkPage instance.
API Tags:
void addContent(
String
$content
)
|
|
Add content to the page.
Parameters:
|
String |
$content: |
The content to add to the page. |
void addScripts(
&$res, [Bool
$partial = false], String
$res
)
|
|
Adds javascripts from the member variables to HTML output
Parameters:
|
String |
$res: |
Reference to the HTML output |
|
Bool |
$partial: |
Is this a partial request or a complete request |
|
|
&$res: |
|
void addStyles(
&$res, [Bool
$partial = false], String
$res
)
|
|
Add stylesheets and stylecodes to the HMTL output
Parameters:
|
String |
$res: |
Reference to the HTML output |
|
Bool |
$partial: |
Is this a partial request or a complete request |
|
|
&$res: |
|
String body(
[String
$extraprops = ""]
)
|
|
Generate the HTML body (<body></body>) statement for the page.
Parameters:
|
String |
$extraprops: |
Extra attributes to add to the <body> tag. |
API Tags:
| Return: | The HTML body, including <body> and </body> tags. |
Returns the current page content.
API Tags:
| Return: | current page content |
Returns a copy of the load scripts.
API Tags:
Return all javascript codes in an array
Return all javascript files
API Tags:
| Return: | contain file paths |
Return all stylesheet files
API Tags:
| Return: | contain file paths |
String head(
String
$title, [String
$extra_header = ""]
)
|
|
Generate the HTML header (<head></head>) statement for the page, including all scripts and styles.
Parameters:
|
String |
$title: |
Title of the html page. |
|
String |
$extra_header: |
HTML code of extra headers to add to the head section |
API Tags:
| Return: | The HTML pageheader, including <head> and </head> tags. |
Check if the page is empty (no content).
This is useful to check at the rendering stage of scripts whether there is something to render.
API Tags:
| Return: | true if there is no content in the page, false if there is |
void register_hiddenvars(
array
$hiddenvars
)
|
|
Register hidden variables. These will be accessible to javascript and DHTML functions/scripts
but will not be shown to the user unless he/she has a very, very old browser that is not capable of rendering CSS
Parameters:
|
array |
$hiddenvars: |
the hiddenvariables we want to register |
void register_loadscript(
String
$code, [
$offset = null]
)
|
|
Register a javascript code statement that is executed on pageload.
Parameters:
|
String |
$code: |
The javascript code fragment to execute on load. |
|
|
$offset: |
|
void register_script(
String
$file, [String
$before = ""]
)
|
|
Register a javascript file to be included.
If called twice for the same filename, the file is loaded only once.
Parameters:
|
String |
$file: |
The (relative path and) filename of the javascript file. |
|
String |
$before: |
The (partial) name of a script that this script should be loaded in front of. This can be used to inject a script before another script, or to avoid conflicts. Usually, this parameter is not needed. |
void register_scriptcode(
String
$code, [Boolean
$before = false]
)
|
|
Register a javascript code statement which will be rendered in the header.
The method has a duplicate check. Registering the exact same statement twice, will result in the statement only being rendered and executed once.
Parameters:
|
String |
$code: |
The javascript code to place in the header. |
|
Boolean |
$before: |
Include the script before the javascript files |
void register_style(
String
$file, [String
$media = 'all']
)
|
|
Register a Cascading Style Sheet.
This method has a duplicate check. Calling it with the same stylesheet more than once, will still result in only one single include of the stylesheet.
Parameters:
|
String |
$file: |
The (relative path and) filename of the stylesheet. |
|
String |
$media: |
The stylesheet media (defaults to 'all'). |
void register_stylecode(
String
$code
)
|
|
Register Cascading Style Sheet fragment that will be included in the page header.
Parameters:
|
String |
$code: |
The Cascading Style Sheet code fragment to place in the header. |
void register_submitscript(
String
$code
)
|
|
Register a javascript code statement that is executed when a form on the page is submitted.
Parameters:
|
String |
$code: |
The javascript code fragment to execute on submit. |
Information Tags:
| Todo: | This is inconsequent, if multiple forms are present, each should have its own submitscripts. Should be moved to an atkForm class. |
String render(
[String
$title = null], [bool|int
$flags = HTML_STRICT], [string
$extrabodyprops = ""], [string
$extra_header = ""]
)
|
|
Render the complete page, including head and body.
Parameters:
|
String |
$title: |
Title of the HTML page. |
|
bool|int |
$flags: |
(bool) Set to true to generate <body> tags. It is useful to set this to false only when rendering content that either already had its own <body></body> statement, or content that needs no body statements, like a frameset. (DEPRICATED !!) (int) Flags for the render function |
|
string |
$extrabodyprops: |
Extra attributes to add to the <body> tag. |
|
string |
$extra_header: |
HTML code of extra headers to add to the head section |
API Tags:
| Return: | The HTML page, including <html> and </html> tags. |
string renderHiddenVars(
)
|
|
Here we render a hidden div in the page with hidden variables
that we want to make accessible to client side scripts
API Tags:
| Return: | a hidden div with the selected ATK variabels |
string renderScriptCode(
string
$position
)
|
|
Renders the registered javascripts, if $position is set to "before" the scripts will be placed before the scripts that are already present. Otherwise they will be appended at the end.
Parameters:
|
string |
$position: |
("before" or "after") |
void setContent(
string
$content
)
|
|
Sets the page content (overwriting current content).
Parameters:
|
string |
$content: |
new page content |
void setTitle(
string
$title
)
|
|
Sets the page title.
Parameters:
|
string |
$title: |
page title |
API Tags:
void unregister_all_scripts(
)
|
|
Unregister all registered javascripts
void unregister_style(
String
$file
)
|
|
Unregister a Cascading Style Sheet.
Parameters:
|
String |
$file: |
The (relative path and) filename of the stylesheet. |
String _getGlobalLoadScriptCode(
[bool
$partial = false]
)
|
|
Get the globalLoad javascript code
Parameters:
|
bool |
$partial: |
Is this a partial request or a complete request |
API Tags:
| Return: | with javascript code |
String _getGlobalSubmitScriptCode(
[bool
$partial = false]
)
|
|
Get the globalSubmit javascript code
Parameters:
|
bool |
$partial: |
Is this a partial request or a complete request |
API Tags:
| Return: | with javascript code |