Adds a custom method to the RaxanWebPage Class. Use addMethod($object) to add multiple methods from an object
static void
addMethod
( $name, [ $callback = null])
Adds a custom property to the RaxanWebPage Class.
static void
addProperty
( $name, [ $value = null])
Returns web page controller object based on the pageId.
Creates and return a DOMDocument
static
RaxanDOMDocument
createDOM
(
$html, [
$charset =
'UTF-8'], [
$type =
null])
Creates and returns an instance of the web page class
Loads the RaxanClientExtension class
static void
loadClientExtension
()
Localize nodes
static void
nodeL10n
( $nodes)
Returns blank html page template
static string
pageCode
([ $type = 'html'], [ $charset = 'UTF-8'], [ $content = ''])
Registers a CSS stylesheet file by name Use the loadCSS() method to load the stylesheet by name.
static void
registerCSS
(string $name, string $src, [array $dependencies = null])
-
string
$name: - Name of script
-
string
$src: - Url for the stylesheer. Set to True if the stylesheet was loaded manually.
-
array
$dependencies
Registers a javascript file by name Use the loadScript() method to load the script by name.
static void
registerScript
(string $name, string $src, [array $dependencies = null])
-
string
$name: - Name of script
-
string
$src: - Url for the script. Set to True if the script was loaded manually.
-
array
$dependencies
Returns a unique id for an elment
static String
uniqueElmId
([ $prefix = null])
RaxanWebPage
__construct
([ $xhtml = ''], [ $charset = null], [ $type = null])
Redefinition of:
- RaxanBase::__construct()
Adds a block of CSS to the webpage
Adds an HTTP header to the page
Adds a block of Javascript to the webpage
RaxanWebPage
addScript
(
string $script, [
string $startupEvent =
null])
-
string
$script
-
string
$startupEvent: Set to either ready, load or unload
Appends the specified content to the page master content block element
-
string
$html: HTML content to append to page body
Appends an html view to the page master content block element
RaxanWebPage
appendView
(
string $view, [
string $selector =
null], [
mixed $data =
null])
-
string
$view: Name of file found inside the views folder. Example: "content.php" or "sidebar.html"
-
string
$selector: Optional CSS selector. Used to filter the contebt of the view
-
mixed
$data: Optional. Data to be used by dynamic views (.php files)
Binds an event to the page body element
Redefinition of:
- RaxanBase::bind()
- Bind the selected event to a callback function
Binds an array of elements to a client-side event - used by RaxanElement
RaxanWebPage
bindElements
(
&$elms,
$type,
$data, [
$fn =
null], [
$selector =
''], [
$delegate =
false])
-
&$elms
-
$type
-
$data
-
$fn
-
$selector
-
$delegate
Returns string containing action scripts and client-side event bindings
String
buildActionScripts
([ $includeEvents = true])
Execute a JavaScript function on th client
RaxanWebPage
callScriptFn
(
string $name, [
mixed $param =
null])
-
string
$name: Name of JavaScript function
-
mixed
$param: Parameter to be passed to function
Returns an instance of the RaxanClientExtension class
Returns or sets the main (body or card) content for an HTML or WML document
Makes the page content downloadable
RaxanWebPage
contentDisposition
(
$fileName, [
$transEncode =
null], [
$fileSize =
null])
-
$fileName
-
$transEncode
-
$fileSize
Set page content type. e.g. text/html
Creates and returns a DOMElement
DOMElement
createElement
( $name, [ $value = null], [ $attribs = null])
Create and return a DOM fragment node
DOMDocumentFragment
createFragment
(string $html)
Get and/or set a named data value for the current page. The data will be preserved during post back requests.
Mixed
&data
(string $name, [mixed $value = null], [boolean $setValueIfNotIsSet = false])
-
string
$name
-
mixed
$value
-
boolean
$setValueIfNotIsSet
Returns or sets the page data storage handler
Binds an event to the selector of the page body element using event delegation
RaxanWebPage
delegate
(
string $selector,
string $type, [
mixed $data =
null], [
mixed $fn =
null])
-
string
$selector: CSS selector
-
string
$type: Event type. Example click
-
mixed
$data: Optional. Event data to be passed to the callback function
-
mixed
$fn: Callback function
Returns RaxanDOMDocument instance
Downloads the content to the browser and stop page execution
void
download
(string $content, [string $fileName = null], [string $contentType = null])
-
string
$content
-
string
$fileName: Optional File name
-
string
$contentType: Optional content type. If not set the sytem will auto detect content-type based on extension otherwise application/octet-stream is used
Dumps the content directly to the browser and stop page execution
void
dump
(string $content, [string $contentType = 'text/html'])
-
string
$content
-
string
$contentType: Defaults to text/html
Ends page event execution and send content to the client. No further events will be processed
Search the page for matched elements
Find and returns a RaxanElement by Id
Find and return matched elements based on specified xpath
Flash a message unto the page. Message will be displayed inside an element with the "flashmsg" class To allow the user to close the message, add a clickable element with a "close" class inside the message.
Here's an example using a close button: <span>Record successfully saved. <a class="close" href="#">Ok</a></span>
RaxanWebPage
flashmsg
([
string $msg =
null], [
string $effect =
null], [
string $class =
null], [
string $id =
null], [
$expose =
null])
-
string
$msg: Message to be displayed
-
string
$effect: Optional jQuery UI effect
-
string
$class: Optional CSS class name to added to the message
-
string
$id: Optional. DOM element id where the message is to be displayed
-
$expose
Returns a copy of a reuseable DOM
DOMDocument
flyDOM
()
Returns a DOMElement based on the Id value
DOMElement
getElementById
( $id)
Returns state data
mixed
&getStateData
([ $type = 'local'])
Returns the content of a view file from within the views folder
string
getView
(string $view, [string $selector = null], [mixed $data = null])
-
string
$view: Name of file found inside the views folder. Example: "content.php" or "sidebar.html"
-
string
$selector: Optional CSS selector. Used to filter the content of the view
-
mixed
$data: Optional. Data input to be used by dynamic views (.php files)
Halt and exit page processing while displaying a message
void
halt
([ $msg = null])
Handle client Postback/Callback events
Handle automatic client-side updates via the CLX
void
handleClientUpdates
()
Send debugging information to client
Localize nodes with the langid attribute set to a valid lcoale key/value pair
Inserts JavaScript into the html document
RaxanWebPage
handleScripts
([
$includeEvents =
true], [
$returnActionScripts =
false])
-
$includeEvents
-
$returnActionScripts
Used internally to hide element from client's browser
RaxanWebPage
hideElementFromClient
(
DOMElement $elm,
boolen $state)
-
DOMElement
$elm
-
boolen
$state
Initialize page data storage handler
Initialize inline events and bind event handlers on the current page
Initialize preserved elements with xt-preservestate attribute
Initialize inline UI widgets
Load CSS stylesheet
RaxanWebPage
loadCSS
(
string $css, [
boolean $extrn =
false])
-
string
$css: The name of css file to be loaded or inline <style> tag to be embedded inside the document
-
boolean
$extrn: Set to true if stylesheet will be loaded from a folder that's not relative to ui/css
Loads a plugin from the plugins folder.
Usage: <p>Raxan::loadPlugin($name,$alias)</p> <p>Raxan::loadPlugin($name,$extrn,$alias)</p>
mixed
loadPlugin
(string $name, [boolean $extrn = false], [string $alias = null])
-
string
$name: Name of plugin file without the .php extension
-
boolean
$extrn: Set to true if plugin will be loaded from a folder that's not relative to {plugins.path}
-
string
$alias: Page propery instance name
Load Javascript library
RaxanWebPage
loadScript
(
string $js, [
boolean $extrn =
false], [
$_priority =
0])
-
string
$js: The name of script file to be loaded or inline <script> tag to be embedded inside the document
-
boolean
$extrn: Set to true if JavaScript library file will be loaded from a folder that's not relative to ui/javascripts
-
$_priority
Loads a CSS theme for the current page
RaxanWebPage
loadTheme
(
string $name, [
boolean $extrn =
false])
-
string
$name: The name of theme (folder) to be loaded
-
boolean
$extrn: Set to true if theme will be loaded from a folder that's not relative to {raxan.url}/ui/css
Used internally to load regsitered UI Widgets
Loads a widget from the widgets folder
boolean
loadWidget
(string $name, [boolean $extrn = false])
-
string
$name: Name of widget file without the .php extension
-
boolean
$extrn: Set to true if theme will be loaded from a folder that's not relative to {widgets.path}
Returns the selector for the master content block
string
masterContentSelector
()
Returns the html content of an elment
string
nodeContent
( $n, [boolean $outer = false])
-
DOMElement
$n
-
boolean
$outer
Check is element exists for the specified selector
Boolean
offsetExists
( $selector)
Implementation of:
- ArrayAccess::offsetExists
Return selectd elements
Implementation of:
- ArrayAccess::offsetGet
Sets HTML for selected elements
Implementation of:
- ArrayAccess::offsetSet
Remove selectd elements
Implementation of:
- ArrayAccess::offsetUnset
Prepends the specified html content to the page master content block element
Redirect client to the specified url
void
redirectTo
(string $url, [ $forceAjax = true], boolean $ajaxEnabled)
-
string
$url
-
boolean
$ajaxEnabled: Optional. Force page redirection during an Ajax request
-
$forceAjax
Redirect to new page view
void
redirectToView
(string $view, [string $url = null], [ $forceAjax = true], boolean $ajaxEnabled)
-
string
$view: View mode
-
string
$url: Optional page url
-
boolean
$ajaxEnabled: Optional. Force page redirection during an Ajax request
-
$forceAjax
Registers a data conduit
-
string
$name: Name of conduit
-
mixed
$fn: Conduit callback handler. Parameters passed to callback handler: $offset,$limit,$params,$rowcount
Registers an event to be triggered from the client using page as the target id
Client-side Example: Raxan.dispatchEvent('customevent',function(result,state){ some code here });
RaxanWebPage
registerEvent
(
$type, [
$data =
null], [
$fn =
null])
Used internally to register a UI widget with the current web page.
Registers a value or variable to be accessed from the client-side Raxan JavaScript library Use registerVar() to send PHP arrays, objects and other datatypes to the client.
To retrieve the value from JavaScript use Raxan.getVar('name');
-
string
$name
-
mixed
$value
Used internally - Remove element state
RaxanWebPage
removeElementState
(
$elm,
string $id, [
string $mode =
'local'])
-
DOMElement
$elm
-
string
$id
-
string
$mode
Render and return html content
string
render
([string $type = 'html'])
-
string
$type: Accepted values: html, xml
Used internally to render regsitered UI Elements
Sends data to client
-
string
$responseType: Accepted values: html, xhtml, xhtml/html, xml, wml
Restore element state. Used internally
RaxanWebPage
restoreElementState
(
$elm,
string $id,
string $mode)
-
DOMElement
$elm
-
string
$id
-
string
$mode
Returns data sanitizer object with get and/or post values. Defaults to post values
Save element state. Used internally
RaxanWebPage
saveElementState
(
$elm,
string $id, [
string $mode =
'local'],
boolean $reset)
-
DOMElement
$elm
-
string
$id
-
string
$mode
-
boolean
$reset: Set to true to reset state data
Sends an error page or message to the web browser and stop page processing.
void
sendError
( $msg, [ $code = null])
Set or returns the page html/xml source. Source can be a file, url or <html> tags
Set or returns the data store name for the page
Returns or sets the title for an HTML page
Transfer page control to the specified php file
void
transferTo
(string $file, [string $autoStartClass = null])
-
string
$file: Physical path and file name of the page to be loaded
-
string
$autoStartClass: Name of page class to be initialized
Trigger events on the specified elements - used by RaxanElement
RaxanWebPage
triggerEvent
(
&$elms,
string $type, [
mixed $args =
null], [
object $eObject =
null],
array $elms)
-
array
$elms: Array or DOMElements
-
string
$type: Event Type. Use the @local suffix to only trigger local events
-
mixed
$args: Optional arugments to to be passed to event handlers
-
object
$eObject: Original event object to passed to handlers
-
&$elms
Used internaly to triggers event/conduit callback handler
Boolean
triggerHandle
(
array $hnd,
RaxanWebPageEvent $e, [
mixed $args =
null], [
boolean $conduit =
null])
-
array
$hnd
-
RaxanWebPageEvent
$e
-
mixed
$args: Event arguments
-
boolean
$conduit: Set to true to trigger conduit callback
Remove event handlers from elements - used by RaxanElement
Update or replace client elements with the content or elements specified
RaxanWebPage
updateClient
(
$selector $selector,
$mode $mode,
mixed $content)
-
mixed
$content: String, Array of DOMElements or a single DOMelement
-
$selector
$selector: String client-side css selector
-
$mode
$mode: String Used internally. possible values 'insert (default), replace, append, prepend, before, after'
Update form fields with postback values
Creates and returns a new RaxanElement from the specified DOM element
RaxanElment
wrapElement
(DOMElement $elm, [ $ui = null])
void
__call
( $name, $args)
Returns a matched element by id using the variable name
Inherited Methods
Inherited From RaxanBase
RaxanBase::__construct()
RaxanBase::bind()
RaxanBase::log()
RaxanBase::objectId()
RaxanBase::trigger()
RaxanBase::unbind()