The documentation is incomplete. The Vae Soli! team works hard to make it as exhaustive as possible with tons of useful examples and easy to understand explanations.
On top of that, we have decided to use our own tool to generate the documentation you read. This also takes time to fine-tune. Our goal is have better documentation, easier to read, easier to use, completely integrated with our site.
Even though NOT finalized, you can now link back to our documentation pages as we have decided once and for all about the structure of our documents and where they all reside on our server.
Thank you very much
The Vae Soli! team.
Generated by The Vae Soli! Documentor: Guide v. 1.3.0018 on 01-04-2015 16:19:56 (DD-MM-YYYY HH:mm:SS). This documentation is built with Vae Soli! functions and classes!
Assertions count: 12
Assertions successful: 12
Assertion failures: 0
LS_ADDRESS_CLASS_PWH
: Define "LS" address class (Pat Was Here)
VAESOLI_PATH
: Define the path where Vae Soli! is installed
VAESOLI_PLUGINS
: Define the path where plugins are located
LSMap.class.php
: Map class
LSV.functions.php
: Global functions of the framework
LSAddress
Class that defines an addressName | Visibility | Type | Description |
---|---|---|---|
$oDictionary |
public | string | Dictionary that must be used to render specific labels |
$oMap |
public | LSMap | Map object |
$szCity |
public | string | City |
$szCountry |
public | string | Country code |
$szID |
public | string | Unique ID of the address |
$szLanguage |
public | string | Language used to render the address. 'fr' by default |
$szMode |
public | string | Mode in which the address must be rendered |
$szStreet |
public | string | Street |
$szStreetNo |
public | string | Street number |
$szTitle |
public | string | Title of the address |
$szZIP |
public | string | ZIP code |
__construct()
: Class constructor__construct( $szTitle )
Name | Type | Description |
---|---|---|
$szTitle |
string | Title of the address. Optional.
null by default |
(void)
// In English $oAddress = new LSAddress( 'Postal Address' ); $oAddress->oDictionary = new LSDictionary( 'en' ); echo ( $x = $oAddress ); echo LSUnitTesting::assert( strstr( $x,'City' ) , 'ASSERTION SUCCESS: City label found' , 'ASSERTION FAILURE: City label NOT found' , 'GuideAssert' ); // In French $oAddress = new LSAddress( 'Adresse de livraison' ); echo ( $x = $oAddress ); echo LSUnitTesting::assert( $oAddress instanceof LSAddress , 'ASSERTION SUCCESS: object successfully created' , 'ASSERTION FAILURE: object NOT created' , 'GuideAssert' ); echo LSUnitTesting::assert( strstr( $x,'Code postal' ) , 'ASSERTION SUCCESS: ZIPCode label found' , 'ASSERTION FAILURE: ZIPCode label NOT found' , 'GuideAssert' );
GuideAssert() ... ASSERTION SUCCESS: City label found
GuideAssert() ... ASSERTION SUCCESS: object successfully created
GuideAssert() ... ASSERTION SUCCESS: ZIPCode label found
3 assertions: 3 successful; 0 failed
__toString()
: Allows the class to decide how it will react when it is treated like a string. A call to Render() is performed.__toString()
None
(string) HTML code that represents the address
$oAddress = new LSAddress( 'Adresse de livraison' ); echo ( $x = $oAddress ); echo LSUnitTesting::assert( $oAddress instanceof LSAddress , 'ASSERTION SUCCESS: object successfully created' , 'ASSERTION FAILURE: object NOT created' , 'GuideAssert' ); echo LSUnitTesting::assert( strstr( $x,'Code postal' ) , 'ASSERTION SUCCESS: ZIPCode label found' , 'ASSERTION FAILURE: ZIPCode label NOT found' , 'GuideAssert' ); echo LSUnitTesting::assert( strstr( $x,'fieldset.LS_VAESOLI_ADDRESS_FORM_FIELDSET_SUFFIX' ), 'ASSERTION SUCCESS: Fieldset found' , 'ASSERTION FAILURE: Fieldset NOT found' , 'GuideAssert' );
GuideAssert() ... ASSERTION SUCCESS: object successfully created
GuideAssert() ... ASSERTION SUCCESS: ZIPCode label found
GuideAssert() ... ASSERTION SUCCESS: Fieldset found
3 assertions: 3 successful; 0 failed
GetDictionaryTerm()
: Get a term from the dictionaryGetDictionaryTerm( $szTerm,$szDefault )
Name | Type | Description |
---|---|---|
$szTerm |
string | Term to look for in the dictionary (key to message) |
$szDefault |
string | Default value in case $szTerm is an unknown
key in the dictionary. |
(string) Message defined in dictionary or null
if message
not found.
$oAddress = new LSAddress(); $szStreet = $oAddress->GetDictionaryTerm( 'Street' ,'NOT FOUND' ); $szPostalCode = $oAddress->GetDictionaryTerm( 'PostalCode','NOT FOUND' ); echo LSUnitTesting::assert( $szStreet === 'NOT FOUND' , 'ASSERTION SUCCESS: Street term NOT found (no dictionary loaded!)' , 'ASSERTION FAILURE: Street term found (no dictionary loaded!)' , 'GuideAssert' ); echo LSUnitTesting::assert( $szPostalCode === 'NOT FOUND' , 'ASSERTION SUCCESS: Postal code NOT term found (no dictionary loaded!)' , 'ASSERTION FAILURE: Postal code found (no dictionary loaded!)' , 'GuideAssert' ); $oAddress->oDictionary = new LSDictionary( 'en' ); $szStreet = $oAddress->GetDictionaryTerm( 'Street' ,'NOT FOUND' ); $szPostalCode = $oAddress->GetDictionaryTerm( 'PostalCode','NOT FOUND' ); echo LSUnitTesting::assert( $szStreet != 'NOT FOUND' , 'ASSERTION SUCCESS: Street term found' , 'ASSERTION FAILURE: Street term NOT found' , 'GuideAssert' ); echo LSUnitTesting::assert( $szPostalCode != 'NOT FOUND' , 'ASSERTION SUCCESS: Street term found' , 'ASSERTION FAILURE: Street term NOT found' , 'GuideAssert' );
GuideAssert() ... ASSERTION SUCCESS: Street term NOT found (no dictionary loaded!)
GuideAssert() ... ASSERTION SUCCESS: Postal code NOT term found (no dictionary loaded!)
GuideAssert() ... ASSERTION SUCCESS: Street term found
GuideAssert() ... ASSERTION SUCCESS: Street term found
4 assertions: 4 successful; 0 failed
Render()
: Renders the address in 'view' mode
This method is like an alias of RenderView
Render( $szSuffix )
Name | Type | Description |
---|---|---|
$szSuffix |
string | Suffix of the address. Optional.
'Suffix' by default.
The suffix is used to distinguish several
addresses that must be rendered at once
in a form (an invoicing address and a
delivery address for example). This
helps distinguish the inner IDs. |
(string) HTML Address code of the address rendered as a fieldset
$oAddress = new LSAddress(); $szHTML = $oAddress->Render(); echo LSUnitTesting::assert( strstr( $szHTML,'fieldset.LS_VAESOLI_ADDRESS_FORM_FIELDSET_SUFFIX' ), 'ASSERTION SUCCESS: Fieldset found' , 'ASSERTION FAILURE: Fieldset NOT found' , 'GuideAssert' );
GuideAssert() ... ASSERTION SUCCESS: Fieldset found
1 assertions: 1 successful; 0 failed
RenderView()
: Renders the address in 'view' modeRenderView( $szSuffix )
Name | Type | Description |
---|---|---|
$szSuffix |
string | Suffix of the address. Optional.
'Suffix' by default.
The suffix is used to distinguish several
addresses that must be rendered at once
in a form (an invoicing address and a
delivery address for example). This
helps distinguish the inner IDs. |
(string) HTML Address code of the address rendered as a fieldset
$oAddress = new LSAddress(); $szHTML = $oAddress->Render(); echo LSUnitTesting::assert( strstr( $szHTML,'fieldset.LS_VAESOLI_ADDRESS_FORM_FIELDSET_SUFFIX' ), 'ASSERTION SUCCESS: Fieldset found' , 'ASSERTION FAILURE: Fieldset NOT found' , 'GuideAssert' );
GuideAssert() ... ASSERTION SUCCESS: Fieldset found
1 assertions: 1 successful; 0 failed