Les avertissements suivants se sont produits :
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
udt et smarty - remplacer methode _compile_source
#1
Citation :#~~~~~ DEBUT BLOC A NE PAS SUPPRIMER ~~~~~
#~ Version du CMS: 1.11.4
#~ Url du site :
#~ Hébergeur / Soft :
#~ Informations Système :
#~~~~~ FIN BLOC A NE PAS SUPPRIMER ~~~~~



Juste un petit truc que je viens de découvrir car j'avais un problème.

Pour remplacer la méthode _compile_source avec smarty 3, dans le wiki il est mentionné d'utiliser :

Code :
[== Indéfini ==]
$smarty = cmsms()->GetSmarty();
$smarty_data = "{menu}";
echo $smarty->display('string:'.$smarty_data) ;

Par contre pour utiliser évaluer la balise smarty et ne pas l'afficher de suite
il faut utiliser $smarty->fetch('string:'.$smarty_data):

pour mon problème, une carte avec mapping ça m'a donné ceci:

Code :
[== Indéfini ==]
$smarty = &cmsms()->GetSmarty();
foreach ($region as $val=>$coo) {

      $val = htmlentities($val, ENT_QUOTES);

      $smarty = &cmsms()->GetSmarty();
      $smarty_data = "{cms_selflink href='region' text='$val' urlparam='?l=$val'}";
    
      echo '<area alt="'.html_entity_decode($val).'" href="'.$smarty->fetch('string:'.html_entity_decode($smarty_data)).'" coords="'.$coo.'" shape="poly">';

}


Pt'être que ça peut servir à d'autres...
Répondre


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)