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


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

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

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

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

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

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


Страницы: Пред. 1 ... 1953 1954 1955 1956 1957
0  
RickyGeork
Читать далее 1хслотс
Имя Цитировать 0  
0  
Social Link - flego
What Makes Online Casinos Are Highly Preferred Worldwide

Digital casinos have revolutionized the gambling market, delivering an exceptional degree of accessibility and variety that traditional establishments are unable to replicate. Throughout the last ten years, millions of players around the world have adopted the adventure of virtual gambling thanks to its accessibility, engaging traits, and progressively larger range of offerings.

If you’re unfamiliar with the world of internet-based gaming or are looking to discover reputable operators, why not sign up for our growing social network? It’s a place where gamblers discuss tips, enabling you to improve your virtual play. Explore the discussions and learn more now: aviator game

One of the key draws of digital gambling sites is the unparalleled selection of entertainment options provided. Whether you enjoy rolling traditional reel games, playing through theme-based thematic slots, or mastering skills in traditional table offerings like Baccarat, digital casinos feature limitless entertainment avenues. Many casinos furthermore offer live casino options, giving you the chance you to communicate with professional croupiers and co-players, all while experiencing the authentic vibes of a real casino from anywhere you want.

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

Beyond variety, virtual gaming providers stand out constant connectivity.
Имя Цитировать 0  
0  
FrankJaf
на этом сайте riobet
Имя Цитировать 0  
0  
RickyGeork
содержание 1хслотс
Имя Цитировать 0  
0  
RobertLop
зайти на сайт rox casino
Имя Цитировать 0  
0  
RickyGeork
Смотреть здесь 1xslots
Имя Цитировать 0  
0  
Brianfew
узнать больше Здесь https://vulkan-777777.ru/
Имя Цитировать 0  
0  
RobertLop
найти это rox casino
Имя Цитировать 0  
0  
FrankJaf
веб-сайте riobet
Имя Цитировать 0  
0  
RickyGeork
Следующая страница 1xslots
Имя Цитировать 0  
0  
Link - flego
Dragon Tiger is considered to have begun in this region and has since extended to gaming venues worldwide, particularly in the Asian market. The game's straightforwardness and swift nature have made it a popular choice among both seasoned gamblers and newcomers. Unlike other card games that require extensive strategies and skills, Dragon Tiger relies largely on luck, making it an attractive choice for those seeking a fast gaming experience. At its basis, Dragon Tiger is comparable to traditional baccarat but simplifies the wagering process. The game is played with a standard deck of 52 cards, and the goal is to anticipate which of the two hands—Dragon or Tiger—will have a more valuable value. Players put their bets before the dealer displays the cards. The hand with the superior card is victorious, and ties are also likely, adding an extra layer of fun.

Direct link: https://www.biographyweb.org/tag/hannah-johnson/

Players can place several types of wagers, including betting on the Dragon, the Tiger, or a tie. The profits varies depending on the type of bet placed, with ties typically delivering the highest payout due to their rarity. This simple betting structure makes Dragon Tiger easy to play to a wide audience, further contributing to its popularity in online casinos.
Имя Цитировать 0  
0  
Rickymef
подробнее 1xslots
Имя Цитировать 0  
0  
RickyGeork
страница 1хслотс
Имя Цитировать 0  
0  
NorbertJib
pharmacie en ligne france fiable: Cialis sans ordonnance 24h - trouver un mГ©dicament en pharmacie
Имя Цитировать 0  
0  
Robertzot
перейти на сайт rox casino
Имя Цитировать 0  
Страницы: Пред. 1 ... 1953 1954 1955 1956 1957
Текст сообщения*
Загрузить файл или картинкуПеретащить с помощью Drag'n'drop
Перетащите файлы
Ничего не найдено
Отправить Отменить
Защита от автоматических сообщений
 
Публикация статей
На данной странице представлены элементы инфоблока статьи, относящиеся к типу Публикации. Статьи опубликованы на странице с помощью комплексного компонента Новостной раздел с указанием параметров инфоблока Статьи. При создании каждой статьи был использован тег <break />, который позволяет осуществить разделение статьи на страницы. В публичном разделе такая статья будет представлена в виде нескольких страниц в зависимости от количества тегов <break />

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