Subversion Repositories Applications.papyrus

Rev

Rev 1463 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1463 alexandre_ 1
<?php
2
 
3
/**
4
* Using I18Nv2_DecoratedList
5
* ==========================
6
*
7
* I18Nv2 provides decorated classes for country and language lists.
8
*
9
* $Id: using_I18Nv2_DecoratedList.php,v 1.1 2007-06-25 09:55:25 alexandre_tb Exp $
10
*/
11
 
12
require_once 'I18Nv2/Country.php';
13
require_once 'I18Nv2/DecoratedList/HtmlSelect.php';
14
require_once 'I18Nv2/DecoratedList/HtmlEntities.php';
15
 
16
$c = &new I18Nv2_Country('it', 'iso-8859-1');
17
$e = &new I18Nv2_DecoratedList_HtmlEntities($c);
18
$s = &new I18Nv2_DecoratedList_HtmlSelect($e);
19
 
20
// set some attributes
21
$s->attributes['select']['name'] = 'CountrySelect';
22
$s->attributes['select']['onchange'] = 'this.form.submit()';
23
 
24
// set a selected entry
25
$s->selected['DE'] = true;
26
 
27
// print a HTML safe select box
28
echo $s->getAllCodes();
29
?>