Translation2
[ class tree: Translation2 ] [ index: Translation2 ] [ all elements ]

Class: Translation2_Decorator_CacheLiteFunction

Source Location: /Translation2-2.0.0beta2/Decorator/CacheLiteFunction.php

Class Overview

Translation2_Decorator
   |
   --Translation2_Decorator_CacheLiteFunction

Decorator to cache fetched data using Cache_Lite_Function class


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: Translation2_Decorator

Translation2_Decorator::Translation2_Decorator()
Constructor
Translation2_Decorator::get()
Get translated string
Translation2_Decorator::getDecorator()
Return an instance of a decorator
Translation2_Decorator::getLang()
get lang info
Translation2_Decorator::getLangs()
get langs
Translation2_Decorator::getPage()
Same as getRawPage, but resort to fallback language and replace parameters when needed
Translation2_Decorator::getRawPage()
Get the array of strings in a page
Translation2_Decorator::replaceEmptyStringsWithKeys()
Replace empty strings with their stringID
Translation2_Decorator::setLang()
Set default lang
Translation2_Decorator::setOption()
set Decorator option
Translation2_Decorator::setOptions()
set Decorator options
Translation2_Decorator::setPageID()
Set default page
Translation2_Decorator::setParams()
Set parameters for next string
Translation2_Decorator::translate()
Get translated string
Translation2_Decorator::_replaceParams()
Replace parameters in strings

Class Details

[line 37]
Decorator to cache fetched data using Cache_Lite_Function class
  • Access: public


[ Top ]


Class Variables

$cacheLiteFunction =  null

[line 46]

Cache_Lite_Function object
  • Access: protected

Type:   object


[ Top ]

$caching =  true

[line 88]

Enable / disable caching

(can be very useful to debug cached scripts)


Type:   boolean


[ Top ]



Method Detail

get   [line 139]

string get( string $stringID, [string $pageID = TRANSLATION2_DEFAULT_PAGEID], [string $langID = null], [string $defaultText = ''])

Get translated string

First check if the string is cached, if not => fetch the page from the container and cache it for later use.


Overrides Translation2_Decorator::get() (Get translated string)

Parameters:

string   $stringID   — 
string   $pageID   — 
string   $langID   — 
string   $defaultText   —  Text to display when the strings in both the default and the fallback lang are empty

[ Top ]

getPage   [line 195]

array getPage( [string $pageID = TRANSLATION2_DEFAULT_PAGEID], [string $langID = null], [ $defaultText = ''])

Same as getRawPage, but resort to fallback language and replace parameters when needed

Overrides Translation2_Decorator::getPage() (Same as getRawPage, but resort to fallback language and replace parameters when needed)

Parameters:

string   $pageID   — 
string   $langID   — 
   $defaultText   — 

[ Top ]

getRawPage   [line 169]

array getRawPage( [string $pageID = TRANSLATION2_DEFAULT_PAGEID], [string $langID = null])

Get the array of strings in a page

First check if the strings are cached, if not => fetch the page from the container and cache it for later use.


Overrides Translation2_Decorator::getRawPage() (Get the array of strings in a page)

Parameters:

string   $pageID   — 
string   $langID   — 

[ Top ]

translate   [line 222]

string translate( string $string, string $langID, [ $pageID = TRANSLATION2_DEFAULT_PAGEID])

Get translated string

Overrides Translation2_Decorator::translate() (Get translated string)

Parameters:

string   $string   —  This is NOT the stringID, this is a real string. The method will search for its matching stringID, and then it will return the associate string in the selected language.
string   $langID   — 
   $pageID   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:56:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.