Авторизация
Логин:
Пароль:
Забыли свой пароль?
Войти как пользователь:
Войти как пользователь
Вы можете войти на сайт, если вы зарегистрированы на одном из этих сервисов:
Подписка на рассылку
Реклама
11 лет сервису WM.mk.ua - WebMoney Exchange in Nikolaev
Расскажи о нас


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

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 | След. | Конец

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

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

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

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


Страницы: Пред. 1 ... 39402 39403 39404 39405 39406 ... 66162 След.
0  
Rickiroca
tor markets 2022  tor markets 2021
Имя Цитировать 0  
0  
JamesBam
buy prescription drugs without doctor pet meds without vet prescription canada canadian drug prices
https://without-prescription-online.online/ buy cheap prescription drugs online
non prescription ed pills prescription drugs online without doctor pet meds without vet prescription canada
Имя Цитировать 0  
0  
Versuszer
darkmarket  tor markets links
Имя Цитировать 0  
0  
JamesBam
buy prescription drugs online buy prescription drugs from canada cheap cvs prescription prices without insurance
https://without-prescription-online.com/ meds online without doctor prescription
online canadian pharmacy buy prescription drugs cvs prescription prices without insurance
Имя Цитировать 0  
0  
JamesAreve
pain medications without a prescription ed prescription drugs online canadian pharmacy
https://without-prescription-online.com/ pet meds without vet prescription
the canadian drugstore prescription drugs online buy canadian drugs
Имя Цитировать 0  
0  
Carlosglowl
dark web market links  darknet drug market
Имя Цитировать 0  
0  
SamuelLeway
tor2door market link  darknet drug links daeva market
Имя Цитировать 0  
0  
SirWem
Имя Цитировать 0  
0  
JohnShelp
tor markets links  deep web markets
Имя Цитировать 0  
0  
Qtcwdz
Имя Цитировать 0  
0  
Williambot
dark web market list  dark web market list
Имя Цитировать 0  
0  
Bryanewen
Thank you! Very good stuff!
easy essay help  college essays   help with report writing
Имя Цитировать 0  
0  
GeraldSox
Good facts. With thanks!
how to write an essay for college  writing service   article writing service
Имя Цитировать 0  
0  
Normandem
tor market  tor market links
Имя Цитировать 0  
0  
Francisnex
Nicely put, Cheers!
us based essay writing service  https://dissertationwritingtops.com/   help with assignment writing
Имя Цитировать 0  
0  
NicolasTaide
Helpful facts. Thank you.
how to write critical essay  how to write a essay about yourself   best custom writing
Имя Цитировать 0  
0  
Charlierit
cvs prescription prices without insurance discount prescription drugs discount prescription drugs
https://without-prescription-online.com/ best online canadian pharmacy
ed drugs online from canada the canadian drugstore cat antibiotics without pet prescription
Имя Цитировать 0  
0  
RiccoShelp
deep web markets  deep web drug store
Имя Цитировать 0  
0  
Gotwqi
Имя Цитировать 0  
0  
JamesAreve
ed meds online without doctor prescription dog antibiotics without vet prescription buy anti biotics without prescription
https://without-prescription-online.online/ pet antibiotics without vet prescription
legal to buy prescription drugs without prescription ed meds online without doctor prescription buy prescription drugs without doctor
Имя Цитировать 0  
0  
AhwPefquw
Имя Цитировать 0  
0  
Williambot
Имя Цитировать 0  
0  
Anoldzer
deep web drug markets  tor marketplace
Имя Цитировать 0  
0  
LawrenceWrito
darknet marketplace  deep web drug markets
Имя Цитировать 0  
0  
WilliamEnume
tor markets links  dark web market
Имя Цитировать 0  
Страницы: Пред. 1 ... 39402 39403 39404 39405 39406 ... 66162 След.
Текст сообщения*
Загрузить файл или картинкуПеретащить с помощью Drag'n'drop
Перетащите файлы
Ничего не найдено
Отправить Отменить
Защита от автоматических сообщений
 
Публикация статей
На данной странице представлены элементы инфоблока статьи, относящиеся к типу Публикации. Статьи опубликованы на странице с помощью комплексного компонента Новостной раздел с указанием параметров инфоблока Статьи. При создании каждой статьи был использован тег <break />, который позволяет осуществить разделение статьи на страницы. В публичном разделе такая статья будет представлена в виде нескольких страниц в зависимости от количества тегов <break />

1QH.net - Unique Quality Hosting.network
liqpay webmoney privat24 visa mastercard
2002-2017 © InKey
All rights reserved