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

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

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

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

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


Страницы: Пред. 1 ... 1570 1571 1572 1573 1574
0  
JuniorImalp
https://zenwriting.net/ebulteuacq/how-to-detect-lead-in-your-cinnamon-a-guide-for-ceylon-cinnamon-lovers


Hey everyone!
I recently came across some shocking information about lead in cinnamon, and I just had to share it with you all. I know we all love the rich flavor and warmth cinnamon brings to our food, but did you know that some cinnamon brands might be contaminated with lead?

I’ve been using cinnamon in my smoothies, oatmeal, and even baked goods for years, so I didn’t think twice about the brand I was choosing. But after doing some research, I learned that certain cinnamon, especially the cheaper varieties, might have dangerous levels of lead. Lead can be harmful, especially if consumed over time, and it can accumulate in your body, leading to health issues like neurological problems and digestive issues.

So, how do you avoid this dangerous lead in cinnamon? Well, I’ve been hunting for safe cinnamon brands, and I’m here to tell you that it’s possible to enjoy cinnamon without the risk. Some brands have been tested to be free from lead, so you can indulge in your favorite spice without worrying about your health.

I highly recommend choosing lead-free cinnamon, and I’ve even compiled a list of the best safe cinnamon brands that you can trust. These brands make sure to test their products thoroughly, so you can enjoy your cinnamon without any worries.

If you want to know more about the dangers of lead in cinnamon and discover which brands to trust, check out my blog. I’ve included everything you need to make an informed decision when buying cinnamon. Don’t compromise your health—learn how to pick safe cinnamon and keep your food delicious and healthy!
Имя Цитировать 0  
0  
RafaelMow
additional reading https://myjaxxwallet.us
Имя Цитировать 0  
0  
Edwardlaw
Имя Цитировать 0  
0  
RafaelWoodo
Имя Цитировать 0  
Страницы: Пред. 1 ... 1570 1571 1572 1573 1574
Текст сообщения*
Загрузить файл или картинкуПеретащить с помощью Drag'n'drop
Перетащите файлы
Ничего не найдено
Отправить Отменить
Защита от автоматических сообщений
 
Публикация статей
На данной странице представлены элементы инфоблока статьи, относящиеся к типу Публикации. Статьи опубликованы на странице с помощью комплексного компонента Новостной раздел с указанием параметров инфоблока Статьи. При создании каждой статьи был использован тег <break />, который позволяет осуществить разделение статьи на страницы. В публичном разделе такая статья будет представлена в виде нескольких страниц в зависимости от количества тегов <break />

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