Class LineBreaks
Located at ext-view-helper-linebreaks/src/MvcCore/Ext/View/Helpers/LineBreaks.php
public
|
#
GetInstance(
Create view helper instance. To configure view helper instance, create it by this method in your $baseController->preDispatch(); method, after view instance inside controller is created, then you can configure anything you want. If Controller contains static property 'Lang', language for this view helper will be loaded from this property. |
public
|
#
__construct(
Create view helper instance. To configure view helper instance, create it by this method in your $baseController->preDispatch(); method, after view instance inside controller is created, then you can configure anything you want. If Controller contains static property 'Lang', language for this view helper will be loaded from this property. |
public
|
#
SetWeekWords( string $weekWords, string $lang = '' )
Set weak words, where you need to place a HTML space entity, to not break line after each configured weak word in processing text. All words has to be configured as single string with all weak words separated by comma character without any space. |
public
|
#
SetShortcuts( string[] $shortcuts, string $lang = '' )
Set special shortcuts for specific language to not have any line break inside. If language is not specified, there is used default language from controller instance. |
public
|
#
SetUnits( string $units )
Set units, where you need to place a HTML space entity, to not break line before each configured unit where is founded digit character before unit and whitespace before in source text. All units has to be configured as single string with all units separated by comma character without any space. |
protected
array
|
#
getWeekWordsUnitsAndShortcuts( string $lang )
Get weak words as array of strings, units and shortcuts. as array of string for currently processed language. |
public
string
|
#
LineBreaks( string $text, string $lang = "" )
Process configured weak words and units and place HTML space entity where is necessary to not line break source text where it's not wanted. |
protected
|
#
processWeakWord( string $word )
Process single weak word - place HTML space entity where is necessary to not line break source text where it's not wanted. |
string |
VERSION
MvcCore Extension - View Helper - Line Breaks - version: Comparation by PHP function version_compare(); |
#
'4.2.0'
|
public
array
|
$WeekWords
Weak words by international language code as array key. Weak words are words, where you dont't want to have a line break after. Weak words have to be configured as string with all weak words separated by comma character without any spaces. |
#
array(
'en' => 'a,an,the,and,but,or,when,of,in,to,with',
// single syllable conjunctions for Czech/Slovak
"cs" => "a,ač,aj,ak,ať,ba,co,či,do,i,k,ke,ku,o,pro,při,s,sa,se,si,sú,v,ve,z,za,ze,že",
)
|
public
array
|
$Shortcuts
Special shortcuts to not have any line break inside, keyed by language. |
#
array(
"cs" => array('př. kr.', 'př. n. l.', 's. r. o.', 'a. s.', 'v. o. s.', 'o. s. ř.',),
)
|
public
string
|
$Units
Units are very short words, where you dont't want to have a line break before, where is any digit before catched unit word and space before catched unit word. Units have to be configured as string with all units separated by comma character without any spaces. |
#
"%,‰,mm,cm,dm,m,km,g,dkg,kg,t,ar,ha,ml,dcl,l,cm²,m²,km²,cm³,m³,°C,°F,K"
|
protected static
|
$instance
Singleton instance. |
|
protected
string
|
$lang
Language used for text processing as default. All text processing shoud be called with custom language value. |
#
""
|
protected
string
|
$text
Source text currently processed. |
#
""
|
protected
array
|
$weekWords
Store with weak words exploded into single strings, keyed by language. |
#
array()
|
protected
string[]
|
$units
Exploded units as array of string to be processed in source text. |
#
array()
|
protected
string[]
|
$shortcuts
Prepared shortcuts with no-line breaking spaces, keyed by language. |
#
array()
|