CMC for PHP
  • Namespace
  • Class
  • Tree

Namespaces

  • cmc
    • core
      • ui
    • db
      • mysqli
    • error
    • ui
      • widgets
  • PHP

Classes

  • documentFrame
  • material
  • widgetView
  • widgetViews

CMC for PHP is a web framework for PHP.
Copyright (c) 2014 by Calmarsoft company http://calmarsoft.com (FRANCE). All rights reserved.
Project information available here.

Class material

Used to build the actual view by loading html parts from files or database

cmc\core\ui\material implements cmc\core\IClonable, cmc\core\ISerializable
Namespace: cmc\core\ui
Copyright: Copyright (c) Calmarsoft company (FRANCE) (http://calmarsoft.com)
License: GNU General Public License version 3
Version: 0.9
Link: CMC Project
Located at core/ui/material.php

Methods summary

public static boolean|string
# seekMaterialFile( string $lang, string $path, string $impl_lang = '' )

find the location of the material, from the generic path load priority:
1/ localized (using $lang)
2/ embedded (if client locale is equal to $impl_lang)
3/ default

Parameters

$lang
string
the language or empty string
$path
string
the material path
$impl_lang
string
the 'implemented' language: the language of the default materials

Returns

boolean|string
the effective absolute path of the material
public static boolean|array
# getCloneFromSource( string $html, DOMDocument|null $tgtdoc )

This function is used to parse an HTML sample and generate a DOM object linked to provided document, if specified

This function is used to parse an HTML sample and generate a DOM object linked to provided document, if specified

Parameters

$html
string
input html sample (doesn't need to have the <html> tag). UTF-8 encoding expected.
$tgtdoc
DOMDocument|null
target document, or null

Returns

boolean|array
the new DOM node
public static
# DOMsetHtml( type $node, type $html_code )

inserts html data in place of a given node

inserts html data in place of a given node

Parameters

$node
type
$elem
$html_code
type
$html_code
public DOMNodeList
# findClassNodes( string $class )

returns the list of Nodes for given classname

returns the list of Nodes for given classname

Parameters

$class
string
classname

Returns

DOMNodeList
public DOMNodeList
# findAttributeNodes( string $attr )

returns the list of Nodes which have the given attribute name

returns the list of Nodes which have the given attribute name

Parameters

$attr
string
attribute name

Returns

DOMNodeList
public DOMNodeList
# findAttributeValueNodes( string $attr, string $value )

returns the list of Nodes which have an attribute with specific value

returns the list of Nodes which have an attribute with specific value

Parameters

$attr
string
attribute name
$value
string
attribute value

Returns

DOMNodeList
public DOMNode|boolean
# findXpathNode( DOMNode|null $parentNode, string $xpath )

returns a node for the given Xpath value

returns a node for the given Xpath value

Parameters

$parentNode
DOMNode|null
the parent from which begin the search
$xpath
string
the xpath value

Returns

DOMNode|boolean
public DOMNodeList|boolean
# findXpathNodes( DOMNode|null $parentNode, string $xpath )

returns the nodes for the given Xpath value

returns the nodes for the given Xpath value

Parameters

$parentNode
DOMNode|null
the parent from which begin the search
$xpath
string
the xpath value

Returns

DOMNodeList|boolean
public DOMNode|boolean
# findCMCParentNode( )

returns false or the first node with the cmc-parent attribute

returns false or the first node with the cmc-parent attribute

Returns

DOMNode|boolean
public NodeAttr
# peekAttribute( DOMNode $node, string $attrName )

finds an attribute in a node, and removes it

finds an attribute in a node, and removes it

Parameters

$node
DOMNode
the input node
$attrName
string
the attribute name

Returns

NodeAttr
the found attribute
public
# replace( DOMNode $position, DOMNode $externalNode, mixed $bMergeAttr = false )

updates the given node with a new value, from an external document

updates the given node with a new value, from an external document

Parameters

$position
DOMNode
$position
$externalNode
DOMNode
$externalNode
$bMergeAttr
public
# setDynamic( )

tells that this material is 'dynamic', which means that content is not identical for a given query path

tells that this material is 'dynamic', which means that content is not identical for a given query path

public
# is_dynamic( )
public
# addScriptCode( string $scriptCode )

used by widgets: adds some initialization script code

used by widgets: adds some initialization script code

Parameters

$scriptCode
string
$scriptCode
public
# addBottomScriptCode( string $scriptcode )

used by widgets: adds some late initialization script code

used by widgets: adds some late initialization script code

Parameters

$scriptcode
string
$scriptCode
public
# prepDelayedJSCode( mixed $view )
public
# endStaticScriptCode( mixed $view )

commits the script code insertion

commits the script code insertion

See

cmc\ui\view::framesDefInit()
cmc\ui\dynview::viewUpdate()
public DOMDocument
# document( )

gets direct access to the DOM document

gets direct access to the DOM document

Returns

DOMDocument
public string|null
# getHTML( )

get the actual HTML code

get the actual HTML code

Returns

string|null
public
# invalidate( )

invalidates the cached html code

invalidates the cached html code

public boolean
# ValidForSave( )

checks if html text can be extracted from this object

checks if html text can be extracted from this object

Returns

boolean
public
# cleanupDOM( )

cleanups the document by removing comment tags

cleanups the document by removing comment tags

public static
# load( mixed $lang, string $path, string $impl_lang = '' )

loads the material from file path, and creates a material object if success

loads the material from file path, and creates a material object if success

Parameters

$lang
mixed
$path
string
the language or empty string
$impl_lang
string
the material path
public
# __construct( mixed $doc, mixed $physpath )
public
# getmtime( )

gets the modification time

gets the modification time

public
# getphyspath( )

gets the physical path

gets the physical path

public
# OnSerialize( )

called before serialization. Need to convert the DOM in text because DOMDocument is not serializable

called before serialization. Need to convert the DOM in text because DOMDocument is not serializable

Implementation of

cmc\core\ISerializable::OnSerialize()
public
# OnUnserialize( )

called after deserialization

called after deserialization

Implementation of

cmc\core\ISerializable::OnUnserialize()
public
# OnClone( mixed $srcinstance )

called after cloning the object

called after cloning the object

Implementation of

cmc\core\IClonable::OnClone()

Magic methods summary

Constants summary

string delayJSObj 'd'
#
CMC for PHP API documentation generated by ApiGen 2.8.0