Last active
December 18, 2015 02:29
-
-
Save tim-bec/5711780 to your computer and use it in GitHub Desktop.
Referenziertes MetaModel laden und daraus einen Translatedtext (introduction) abrufen, kürzen, abschneiden und ausgeben.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#Vorbereiten | |
$longtext = MetaModelFactory::byTableName('mm_projects')->findById($arrItem['raw']['project']['id'])->get('introduction'); | |
# Longtext an string übergeben | |
$string = $longtext['value']; | |
$string = (strlen($string) > 123) ? substr($string,0,120).'...' : $string; | |
echo $string; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the short variant ;)
https://gist.github.com/andreasisaak/5712103