PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Julien PACHET  >  i18n  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: i18n
Get translations texts from XML files
Author: By
Last change:
Date: 9 years ago
Size: 767 bytes
 

Contents

Class file image Download
<?
   
require_once("class_i18n.inc.php");
   
   
/**
    * www_filename() : return the the filename of self script
    *
    * @return
    **/
   
function www_filename() {
     
      global
$_SERVER;
     
$temp=explode("/",$_SERVER["PHP_SELF"]);
      return
$temp[count($temp)-1];
    }
   
   
$a=new i18n(www_filename(),'uk');
   
   
$tab1=array(0,1,2,3);
   
$tab2=array(1);

?>
<html>
    <head>
        <title><? echo $a->get('title');?></title>
    </head>
    <body>
        <?
           
echo $a->get('body,simple_text');
            echo
"<br><br>\n";
            echo
$a->get('body,param_text',array('a value','another value'));
            echo
"<br><br>\n";
            echo
$a->get('body,tab,tab1',count($tab1));
            echo
"<br><br>\n";
            echo
$a->get('body,tab,tab2',count($tab2));
       
?>
</body>
</html>