Авторизация
Логин:
Пароль:
Забыли свой пароль?
Войти как пользователь:
Войти как пользователь
Вы можете войти на сайт, если вы зарегистрированы на одном из этих сервисов:
Подписка на рассылку
Реклама
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 | След. | Конец

Количество показов: 75387924
Рейтинг:  3.3

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

(Голосов: 1, Рейтинг: 3.3)

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


Страницы: Пред. 1 ... 2451 2452 2453 2454 2455
0  
Lawyer - flego
Looking for the Top Vehicle Crash Lawyer Near You

If you have been in a vehicle crash, having the right auto accident attorney can greatly impact your case. A skilled attorney can help you handle claims with insurers, secure fair compensation, and even represent you in court if required.

How to Find the Most Suitable car accident lawyer edmonton Close to You

- Consider Expertise – Choose a lawyer with a strong track record in handling auto injury claims.
- Look at Client Feedback – Reviews from past clients can help you understand a lawyer’s competence.
- Initial Case Reviews – Many attorneys offer a no-cost first meeting, so take advantage of this to discuss your case.
- Familiarity with Local Courts – Searching for a nearby vehicle crash lawyer ensures that they are experienced with local traffic laws.
- Pay Only If You Win – Many personal injury lawyers work on a no-win, no-fee structure, meaning you don’t pay unless they win your case.

Direct link: http://uchelo.nnov.org/common/redir.php?https://lawyer4caraccident.ca/

Why You Need an Attorney

Even if your accident seems straightforward, insurance companies often try to offer less than you deserve. A experienced accident lawyer can fight for the compensation, including treatment costs, income loss, and emotional distress.

If you need a lawyer, don’t wait—get the legal support you need today and fight for your claim!
Имя Цитировать 0  
0  
Social Link - flego
The Reasons Behind Why Online Casinos Are Becoming So Popular

Virtual gambling platforms have revolutionized the gambling world, providing an exceptional degree of accessibility and variety that land-based gambling houses can’t match. Throughout the last ten years, a growing community around the world have adopted the excitement of virtual gambling due to its availability, captivating elements, and widening selection of games.

If you’re exploring for the first time with the world of digital casinos or hope to delve deeper into safe services, why not participate in our active interactive platform? It’s a platform where players exchange reviews, guiding you to improve your gambling adventure. Join the community and visit us now: https://t.me/plinko_romania

One of the biggest attractions of virtual gambling hubs is the sheer array of entertainment options on offer. Whether you enjoy playing on old-school slot machines, diving into theme-based video slots, or strategizing in card and board games like Roulette, virtual venues offer numerous choices. Plenty of operators additionally offer live casino options, giving you the chance you to communicate with actual dealers and other players, all while experiencing the authentic ambiance of a real casino in your own space.

Social URL: https://t.me/plinko_romania

Beyond variety, online casinos shine seamless entry.
Имя Цитировать 0  
0  
DonaldRah
darkmarket url  darkmarkets
Имя Цитировать 0  
0  
DonaldRah
dark web marketplaces  darknet market
Имя Цитировать 0  
0  
Tolikovemo
Имя Цитировать 0  
0  
DonaldRah
dark web marketplaces  darknet markets onion
Имя Цитировать 0  
0  
DonDonTyday
darknet sites  dark web sites
Имя Цитировать 0  
0  
DonDonTyday
dark markets  dark web markets
Имя Цитировать 0  
0  
PingPap
darknet sites  dark websites
Имя Цитировать 0  
Страницы: Пред. 1 ... 2451 2452 2453 2454 2455
Текст сообщения*
Загрузить файл или картинкуПеретащить с помощью Drag'n'drop
Перетащите файлы
Ничего не найдено
Отправить Отменить
Защита от автоматических сообщений
 
Публикация статей
На данной странице представлены элементы инфоблока статьи, относящиеся к типу Публикации. Статьи опубликованы на странице с помощью комплексного компонента Новостной раздел с указанием параметров инфоблока Статьи. При создании каждой статьи был использован тег <break />, который позволяет осуществить разделение статьи на страницы. В публичном разделе такая статья будет представлена в виде нескольких страниц в зависимости от количества тегов <break />

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