Table of Contents Previous Next
Logo
Client-Side Slice-to-PHP Mapping : 28.4 Mapping for Modules
Copyright © 2003-2010 ZeroC, Inc.

28.4 Mapping for Modules

By default, identifiers defined within a Slice module are mapped to a flattened symbol that uses underscores as module separators. Consider the following Slice definition:
module M {
    module N {
        enum Color { red, green, blue };
    };
};
The Slice identifier Color maps to M_N_Color by default because PHP releases prior to version 5.3 lacked language support for namespaces. If you prefer to use namespaces instead, you can enable an alternate mapping in which Slice modules map to PHP namespaces with the same name as the Slice module. This mapping preserves the nesting of the Slice definitions. Using the namespace mapping, the Slice identifier Color maps to \M\N\Color.

Table of Contents Previous Next
Logo