Авторизация
Логин:
Пароль:
Забыли свой пароль?
Войти как пользователь:
Войти как пользователь
Вы можете войти на сайт, если вы зарегистрированы на одном из этих сервисов:
Подписка на рассылку
Реклама
11 лет сервису InKey.Biz.ua - Интернет бизнес под ключ.
Расскажи о нас


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

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

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

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

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

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


Страницы: Пред. 1 ... 1493 1494 1495 1496 1497
0  
Andrewspics
чит гта 5 - приватные читы на кс го, midnight im  ксго чит
Имя Цитировать 0  
0  
WillieProre
easy canadian pharm: legit canadian online pharmacy - easy canadian pharm
Имя Цитировать 0  
0  
Andrewspics
читы для апекс - скачать читы cs go, приватный чит для кс
Имя Цитировать 0  
0  
JuniorImalp
https://blog.rackons.in/national-ranking-countertops-contractors-your-go-to-directory-for-top-countertop-experts-in-the-us


Have you ever been overwhelmed by the search for the right countertop contractor? I totally get it – the choices can be dizzying! But let me tell you, there’s a simple solution that will save you time and effort: a national directory of countertop contractors. I’ve been using it for a while now, and it's honestly been a game-changer for my home improvement projects.

This directory doesn’t just provide a random list of contractors; it gives you a national ranking of the best in the business. You’ll find detailed information about each one, including customer reviews, specialties, and even before-and-after photos of their past projects. The transparency and organization are impressive.

No matter where you are in the U.S., this directory makes it easy to narrow down your search. Plus, it includes helpful filters so you can choose contractors based on factors like material expertise (marble, granite, etc.), service area, and budget range. This saves so much time compared to scrolling endlessly through random websites or relying on word-of-mouth recommendations that might not be reliable.

If you’re planning a countertop renovation, this directory is an invaluable tool. It takes the guesswork out of finding the perfect contractor and helps ensure you’ll be working with someone who has a proven track record. Don’t waste time – check out this directory and get started on your project today. You’ll thank me later!
Имя Цитировать 0  
0  
MarkPet
Приветствую. Подскажите, где почитатьразные статьи о займах? Пока нашел - buhgalter-ekspert.ru
Имя Цитировать 0  
0  
MarkJulge
Приветствую. Подскажите, где почитатьполезные блоги о займах? Пока нашел - buhgalter-ekspert.ru
Имя Цитировать 0  
0  
MarkPet
Привет. Может кто знает, где почитатьполезные блоги о кредитах? Сейчас читаю - https://komisionka26.ru
Имя Цитировать 0  
0  
MarkJulge
Всем привет! Подскажите, где почитатьразные статьи о кредитах? Сейчас читаю - https://komisionka26.ru
Имя Цитировать 0  
Страницы: Пред. 1 ... 1493 1494 1495 1496 1497
Текст сообщения*
Загрузить файл или картинкуПеретащить с помощью Drag'n'drop
Перетащите файлы
Ничего не найдено
Отправить Отменить
Защита от автоматических сообщений
 
Публикация статей
На данной странице представлены элементы инфоблока статьи, относящиеся к типу Публикации. Статьи опубликованы на странице с помощью комплексного компонента Новостной раздел с указанием параметров инфоблока Статьи. При создании каждой статьи был использован тег <break />, который позволяет осуществить разделение статьи на страницы. В публичном разделе такая статья будет представлена в виде нескольких страниц в зависимости от количества тегов <break />

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