Last active
August 29, 2015 14:15
-
-
Save MikSDigital/a4f94b08970cb0988ad1 to your computer and use it in GitHub Desktop.
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 | |
// сниппет отдает поле pagetitle текущей страницы. | |
// Если в адресе передан параметр lang, то выбирается соответствующий языковой TV из ресурса (nameRus, nameEng) | |
if (isset($_GET['lang'])) { | |
$lang= $modx->sanitizeString($_GET['lang']); | |
return $lang; | |
} | |
// Ниже строки просто как шпаргалка, к делу не относится! | |
$tv = $modx->getObject('modTemplateVar',array('name'=>'nameRus')); | |
$val = $tv->renderOutput($modx->resource->get('id')); | |
$a=' '; | |
foreach($_GET as $key=>$value) | |
{ | |
$a=$a.$key; | |
} | |
return $modx->resource->get('pagetitle'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment