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 22-02-2014 18:04:34 (DD-MM-YYYY HH:mm:SS). This documentation is built with Vae Soli! functions and classes!
Assertions count: 2
Assertions successful: 2
Assertion failures: 0
LSFootnotes
: Define "LS" footnotes (Pat Was Here)
VAESOLI_PATH
: Define the path where Vae Soli! is installed
VAESOLI_PLUGINS
: Define the path where plugins are located
LSV.functions.php
: Vae Soli! Foundation functions
LSVfc.class.php
: Vae Soli! Foundation classes
LSFootnotes
A LSFootnotes
object gathers notes in an array. The full
array of notes can then be rendered later at some point. Notes
can be added in the flow of a text. Each note is replaced by a
superscript reference that points to the actual note. When notes
are all rendered, it is easy to go back to the original text where
the note was added in the first place.Name | Visibility | Type | Description |
---|---|---|---|
$aNotes |
public | array | An array of notes that must be rendered at some point |
$iStart |
public | int | Counter start. 0 by default. DO NOT USE NEGATIVE NUMBERS. |
$iTeaserLength |
public | int | The length of the teaser |
$szPrefix |
public | string | A prefix that will be added to the note counter when it is rendered |
__construct()
: Constructs a footnote object__construct( $x )
Name | Type | Description |
---|---|---|
$x |
mixed | Either an integer or a LSFootnotes object that is
used to initialize the $iStart reference of the
new footnotes object to be created. Optional.
null by default. |
(void)
$oNotes = new LSFootnotes(); <!-- Here you have HTML code where footnotes will be added in a similar way : <p>Our slogan is OSF <?php echo $oNotes->Add( 'Open, simple, fast' ); ?> --> echo $oNotes->Render();
$oNotes1 = new LSFootnotes( 3 ); $oNotes1->Add( "Third note" ); $oNotes1->Add( "Fourth note" ); $oNotes2 = new LSFootnotes( $oNotes1 ); $oNotes2->Add( "Fifth note" ); $oNotes2->Add( "Sixth note" ); echo $oNotes1->Render(); echo $oNotes2->Render();
[3] … Third note
[4] … Fourth note
[5] … Fifth note
[6] … Sixth note
WARNING: No Unit Testing found. Please provide assertions with assertion constructs ({*assert ... *}
) or with GuideAssert()
function calls in exec constructs ({*exec ... *}
).
Add()
: Adds a new note to the internal array of notes.Add( $x,$szRef,$bAdd )
Name | Type | Description |
---|---|---|
$x |
mixed | Can be either a string or a tag (LSTag ).
Later on, this parameter might be something
different such as a reference, a citation, ... |
$szRef |
string | Reference that will be assigned to the note that
must be added. Optional. null by default in
which case the class will create an internal reference
that might change at each generation (md5(guid()) ). |
$bAdd |
bool | Should the note be added or not. Optional.
true by default. If false , then
$szRef must be passed for the note to be added as it
is supposed to replace the existing reference. |
(string) HTML code that represents the superscript reference
$oNotes = new LSFootnotes(); <!-- Here you have HTML code where footnotes will be added in a similar way : <p>Our slogan is OSF <?php echo $oNotes->Add( 'Open, simple, fast' ); ?> --> echo $oNotes->Render();
$oNotes = new LSFootnotes(); $oNotes->szPrefix = 'Ex-'; $oNotes->iTeaserLength = 30; echo "<p>Slogan is OSF " . $oNotes->Add( 'Open, simple, fast ... this has been our motto for 25 years' ) . "</p>"; echo "<p>What's yours?" . $oNotes->Add( 'Mine is to be true' ) . "</p>"; LSUnitTesting::assert( strlen( $oNotes->aNotes[0][1] ) === 32 , 'ASSERTION SUCCESSFUL: footnote has received a plausible reference' , 'ASSERTION FAILURE: incorrect reference' , 'GuideAssert' ); LSUnitTesting::assert( count( $oNotes->aNotes ) === 2 , 'ASSERTION SUCCESSFUL: right number of footnotes' , 'ASSERTION FAILURE: incorrect count of footnotes' , 'GuideAssert' ); echo "<p>Footnotes</p>"; echo $oNotes->Render();
Slogan is OSF [Ex-1]
What's yours?[Ex-2]
Footnotes
[Ex-1] … Open, simple, fast ... this has been our motto for 25 years
[Ex-2] … Mine is to be true
2 assertions: 2 successful; 0 failed
Clear()
: Clears all footnotesClear()
None
(void)
$oNotes = new LSFootnotes(); $oNotes->iTeaserLength = 30; echo "<p>Slogan is OSF " . $oNotes->Add( 'Open, simple, fast ... this has been our motto for 25 years' ) . "</p>"; echo "<p>Our next slogan is WSWWTWDWWSWAWWD " . $oNotes->Add( 'We Say What We Think; We Do What We Say; We Are What We Do!' ) . "</p>"; $oNotes->Clear(); if ( count( $oNotes->aNotes ) > 0 ) { echo "<p>Footnotes</p>"; echo $oNotes->Render(); } else { echo "<p>No footnote found!</p>"; }
Slogan is OSF [1]
Our next slogan is WSWWTWDWWSWAWWD [2]
No footnote found!
WARNING: No Unit Testing found. Please provide assertions with assertion constructs ({*assert ... *}
) or with GuideAssert()
function calls in exec constructs ({*exec ... *}
).
Ref()
: Refers to an existing footnote
A call to Ref() is identical to a call to Add( '',
;
$szRef
,false )
Ref( $szRef )
Name | Type | Description |
---|---|---|
$szRef |
string | Reference of the existing footnote |
(string) HTML code that represents the reference.
$oNotes = new LSFootnotes(); $oNotes->iTeaserLength = 30; $oNotes->iStart = 4; echo "<p>Slogan is OSF " . $oNotes->Add( 'Open, simple, fast ... this has been our motto for 25 years','OSF' ) . "</p>"; echo "<p>A lot of blahblablah</p>"; echo "<p>Remember our slogan " . $oNotes->Ref( 'OSF' ) . "</p>"; echo "<p>Footnotes</p>"; echo $oNotes->Render();
Slogan is OSF [4]
A lot of blahblablah
Remember our slogan [4]
Footnotes
[4] … Open, simple, fast ... this has been our motto for 25 years
WARNING: No Unit Testing found. Please provide assertions with assertion constructs ({*assert ... *}
) or with GuideAssert()
function calls in exec constructs ({*exec ... *}
).
Render()
: Renders all footnotes
Notes are rendered in paragraphs: ... ...
Render()
None
(string) HTML code that represents all the footnotes
$oNotes = new LSFootnotes(); <!-- Here you have HTML code where footnotes will be added in a similar way : <p>Our slogan is OSF <?php echo $oNotes->Add( 'Open, simple, fast' ); ?> --> echo $oNotes->Render();
WARNING: No Unit Testing found. Please provide assertions with assertion constructs ({*assert ... *}
) or with GuideAssert()
function calls in exec constructs ({*exec ... *}
).