Авторизация
Логин:
Пароль:
Забыли свой пароль?
Войти как пользователь:
Войти как пользователь
Вы можете войти на сайт, если вы зарегистрированы на одном из этих сервисов:
Подписка на рассылку
Реклама
1QH.net - Unique Quality Hosting.network
Расскажи о нас


Пользовательские движки шаблонизации

02.10.2009

Пример подключения движка XML/XSLT:

Сначала регистрируем движок:

global $arCustomTemplateEngines;
$arCustomTemplateEngines = array(
   "xslt" => array(
      "templateExt" => array("xsl"),
      "function" => "XSLTEngine"
   ),
);

Функция инициализации параметров движка:

function CreateXMLFromArray($xDoc, $xNode, $ar)
{
   foreach($ar as $key=>$val)
   {
      if(!is_string($key) || strlen($key)<=0)
         $key = "value";

      $xElement = $xDoc->createElement($key);
      if(is_array($val))
      {
         CreateXMLFromArray($xDoc, $xElement, $val);
      }
      else
      {
         $xElement->appendChild($xDoc->createTextNode(iconv( SITE_CHARSET, "utf-8", $val)));
      }
      $xNode->appendChild($xElement);
   }
   return $xNode;
}

Функция подключения движка:

function XSLTEngine($templateFile, $arResult, $arParams, $arLangMessages, $templateFolder, $parentTemplateFolder, $template)
{
   $arResult["PARAMS"] = array(
      "templateFolder" => $templateFolder,
      "parentTemplateFolder" => $parentTemplateFolder,
      "arParams" => $arParams,
      "arLangMessages" => $arLangMessages
   );

   $xDoc = new DOMDocument("1.0", SITE_CHARSET);
   $xRoot = $xDoc->createElement('result');
   CreateXMLFromArray($xDoc, $xRoot, $arResult);
   $xDoc->appendChild($xRoot);

   $xXsl = new DOMDocument();
   $xXsl->load( $_SERVER["DOCUMENT_ROOT"].$templateFile );

   $xProc = new XSLTProcessor;
   $xProc->importStyleSheet($xXsl);

   echo $xProc->transformToXML($xDoc);
}


Страница 3 - 3 из 3
Начало | Пред. | 1 2 3 | След. | Конец

Количество показов: 40277491

Возврат к списку

(Нет голосов)

Материалы по теме:


Страницы: Пред. 1 ... 11128 11129 11130 11131 11132 ... 66169 След.
0  
DiempragEmimi
essaytyper  essay writing services essay writing  essay help  https://essaywriting24h.com/
Имя Цитировать 0  
0  
ArnoldJed
cost for cialis 5mg purchase peptides tadalafil cialis pharmacy price comparison
buy cialis pills daily cialis dosage cialis and blood sugar
Имя Цитировать 0  
0  
Mtkygb
Имя Цитировать 0  
0  
ArnoldJed
online tadalafil 20mg cialis strength cialis vs viagra comparison
cost cialis tadalafil online cialis side effects
Имя Цитировать 0  
0  
ArnoldJed
cialis daily price cialis price mexico cialis from mexico
cialis tablet cialis from us pharmacy tadalafil price in india
Имя Цитировать 0  
0  
chomaAccoug
how to write essay  https://essaywritingup.com/  essay writer online  how to write an essay paper help
Имя Цитировать 0  
0  
Achiemecubbaive
research paper  college essays homework helper  write a paper my homework
Имя Цитировать 0  
0  
fruiceaccilycle
Имя Цитировать 0  
0  
fruiceaccilycle
plaquenil 200 mg  buy plaquenil does hydroxychloroquine work  hcq medication  https://hydrochloroquinetrx.com/
Имя Цитировать 0  
0  
moitwotGulali
where to buy chloroquine  antimalarial drugs hydroxychloroquine  plaquenil drug chloroquine otc canada  https://hydroxychloroquineth.com/
Имя Цитировать 0  
0  
vicaiscurelia
buy plaquenil  buy chloroquine buy chloroquin  plaquenil online  https://aralenquinesen.com/
Имя Цитировать 0  
0  
ArnoldJed
cialis coupon research chemicals tadalafil generic tadalafil
cialis 5mg pharmacy cialis 50mg generic cialis goodrx
Имя Цитировать 0  
0  
Ulgeoa
Имя Цитировать 0  
0  
MouckyMourgyBox
buy an essay  my college help with writing paper  https://essaywritingbot.com/
Имя Цитировать 0  
0  
vicaiscurelia
help me with my homework  https://essaywritingcorp.com/  paper help  essay typer essay typer generator
Имя Цитировать 0  
0  
VuselsGlodserly
how to write a essay  https://paperwriteract.com/  buy dissertation paper  the last hour essaytyper
Имя Цитировать 0  
0  
ecoriuffego
https://essaywritingup.com/  online essay writer  how to write a paper in apa format  writing paper essay helper
Имя Цитировать 0  
0  
VuselsGlodserly
https://myessayfriend.com/  auto essay writer  essay writer buy dissertation online https://myessayfriend.com/  dissertation help online  essay hook generator  write my essay generator online homework  how to write an essay  write essay  thesis writing help online essay writer  personal essay writing paper help  my essay writer dissertation online  https://myessayfriend.com/
Имя Цитировать 0  
0  
ecoriuffego
how to do your homework  write essay for you  do your homework buy dissertation paper  https://instantcollegeessay.com/
Имя Цитировать 0  
0  
DiempragEmimi
writes your essay for you  college essay writing services  personal essay paper writing services  https://myinstantessaywriters.com/
Имя Цитировать 0  
0  
moitwotGulali
argumentative essay  essay paper writing  paper writer doing homework  essay helper essay bot  essay writing writing essay  help me with my essay free essay writer  dissertation help online  easy essay writer  essay paper writing essay format  https://myessayfriend.com/  college essays  https://myessayfriend.com/  online homework  free essay writer essay writing software
Имя Цитировать 0  
0  
chomaAccoug
https://instantcollegeessay.com/  essay writing service  best essay writer  how to do your homework good essay writing
Имя Цитировать 0  
0  
ArnoldJed
generic cialis free shipping tadalafil 10mg cialis or viagra
tadalafil dosage 40 mg best price tadalafil cialis cost in usa
Имя Цитировать 0  
0  
moitwotGulali
hydroxychloroquine buy  buy hydroxychloroquine chloroquin  plaquenil online  https://chloroquinendi.com/
Имя Цитировать 0  
0  
moitwotGulali
Имя Цитировать 0  
Страницы: Пред. 1 ... 11128 11129 11130 11131 11132 ... 66169 След.
Текст сообщения*
Загрузить файл или картинкуПеретащить с помощью Drag'n'drop
Перетащите файлы
Ничего не найдено
Отправить Отменить
Защита от автоматических сообщений
 
Публикация статей
На данной странице представлены элементы инфоблока статьи, относящиеся к типу Публикации. Статьи опубликованы на странице с помощью комплексного компонента Новостной раздел с указанием параметров инфоблока Статьи. При создании каждой статьи был использован тег <break />, который позволяет осуществить разделение статьи на страницы. В публичном разделе такая статья будет представлена в виде нескольких страниц в зависимости от количества тегов <break />

liqpay webmoney privat24 visa mastercard
2002-2017 © InKey
All rights reserved