\Xima\XmTools\Classes\HelperServices

Static helper methods, independent of context like TYPO3.

..

Summary

Methods
Properties
Constants
loadJson()
loadFileContent()
curlLoad()
truncate()
cleanString()
getGeoCoding()
reverseGeoCoding()
replacePlaceholder()
loadCvsAsAssocArray()
debug()
arrayByKeyToCsv()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

loadJson()

loadJson(string  $file, string  $type = 'array') : mixed

Json laden.

Parameters

string $file

Path with filename

string $type

array|json

Returns

mixed

loadFileContent()

loadFileContent(string  $file) : string

Load file content.

Parameters

string $file

Returns

string

curlLoad()

curlLoad(string  $url, boolean  $convertJsonToArray = false) : mixed

Loads data with curl.

Parameters

string $url
boolean $convertJsonToArray

Returns

mixed

truncate()

truncate(string  $text, integer  $limit = 200,   $end = null, string  $encodiung = 'UTF-8') : string

Truncate.

Parameters

string $text
integer $limit
$end
string $encodiung

Returns

string

cleanString()

cleanString(  $string) : string

Bereinigt Strings von Umlauten, Sonder- und Leerzeichen.

Parameters

$string

Returns

string

getGeoCoding()

getGeoCoding(string  $city, \Xima\XmTools\Classes\Helper\string/int  $postcode, string  $street, \Xima\XmTools\Classes\Helper\string/int  $nr, string  $sensor = 'false') : array

Geokodierung mit Google GeoCoding API V3 https://developers.google.com/maps/documentation/geocoding/?hl=de.

Parameters

string $city
\Xima\XmTools\Classes\Helper\string/int $postcode
string $street
\Xima\XmTools\Classes\Helper\string/int $nr
string $sensor

('true'|'false')

Returns

array

reverseGeoCoding()

reverseGeoCoding(float  $lat, float  $lng,   $sensor = 'false') : \Xima\XmTools\Classes\Helper\type

Die Adresse zu Geokoordinaten mittels Google GeoCoding API V3 ermitteln https://developers.google.com/maps/documentation/geocoding/?hl=de#ReverseGeocoding.

Parameters

float $lat
float $lng
$sensor

Returns

\Xima\XmTools\Classes\Helper\type —

array

replacePlaceholder()

replacePlaceholder(array  $placeholder, string  $string) : string

Parameters

array $placeholder
string $string

Returns

string

loadCvsAsAssocArray()

loadCvsAsAssocArray(string  $file, string  $delimiter = ',') : \Xima\XmTools\Classes\Helper\type

Parameters

string $file
string $delimiter

Returns

\Xima\XmTools\Classes\Helper\type

debug()

debug(mixed  $array, string  $title = null) 

Print arrays for debugging.

Parameters

mixed $array
string $title

arrayByKeyToCsv()

arrayByKeyToCsv(array  $array, string  $key, string  $separator = ', ') : string

Converts array values into CSV.

Parameters

array $array
string $key
string $separator
  • Default: ', '

Returns

string