Overview

Namespaces

  • MvcCore
    • Ext
      • Auth
        • Virtual
      • Debug
        • Tracy
      • Form
        • Core
        • Validators
      • Request
      • Router
        • Lang
      • View
        • Helpers
  • None

Classes

  • Assets
  • Css
  • Js
  • LineBreaks
  • Overview
  • Namespace
  • Class
  • Tree

Class LineBreaks

Namespace: MvcCore\Ext\View\Helpers
Located at ext-view-helper-linebreaks/src/MvcCore/Ext/View/Helpers/LineBreaks.php
Methods summary
public
# GetInstance( MvcCore\View & $view = NULL )

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.

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.

Parameters

$view
public
# __construct( MvcCore\View & $view = NULL )

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.

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.

Parameters

$view
public MvcCore\Ext\View\Helpers\LineBreaks
# 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.

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.

Parameters

$weekWords
all weak words as string separated by comma character
$lang
optional, international language code

Returns

MvcCore\Ext\View\Helpers\LineBreaks
public MvcCore\Ext\View\Helpers\LineBreaks
# 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.

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.

Parameters

$shortcuts
shortcuts as array of strings
$lang
optional, international language code

Returns

MvcCore\Ext\View\Helpers\LineBreaks
public MvcCore\Ext\View\Helpers\LineBreaks
# 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.

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.

Parameters

$units
all units as string separated by comma character

Returns

MvcCore\Ext\View\Helpers\LineBreaks
protected array
# getWeekWordsUnitsAndShortcuts( string $lang )

Get weak words as array of strings, units and shortcuts. as array of string for currently processed language.

Get weak words as array of strings, units and shortcuts. as array of string for currently processed language.

Parameters

$lang
international language code

Returns

array
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.

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.

Parameters

$text
source text
$lang
optional, international language code

Returns

string
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.

Process single weak word - place HTML space entity where is necessary to not line break source text where it's not wanted.

Parameters

$word
Constants summary
string VERSION

MvcCore Extension - View Helper - Line Breaks - version: Comparation by PHP function version_compare();

MvcCore Extension - View Helper - Line Breaks - version: Comparation by PHP function version_compare();

See

http://php.net/manual/en/function.version-compare.php
# '4.2.0'
Properties summary
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.

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.

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.

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 MvcCore\Ext\View\Helpers\LineBreaks $instance

Singleton instance.

Singleton instance.

#
protected string $lang

Language used for text processing as default. All text processing shoud be called with custom language value.

Language used for text processing as default. All text processing shoud be called with custom language value.

# ""
protected string $text

Source text currently processed.

Source text currently processed.

# ""
protected array $weekWords

Store with weak words exploded into single strings, keyed by language.

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.

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.

Prepared shortcuts with no-line breaking spaces, keyed by language.

# array()
MvcCore API documentation generated by ApiGen