[Cartoweb-users] cw3.1: php coding in mapfile templates (update)

Emmanuel Belo emmanuel.belo at microgis.ch
Fri Feb 24 05:28:25 EST 2006


After some talk with Yves Bolognini, the php code should be escaped for
the eval() function:

For our case, theses lines work fine:

\$emmanuel = array('test');
\$emmanuel[] = '1';
array_push(\$emmanuel, '1');
print_r(\$emmanuel);

It is strange that only $ should be escaped, but for now it works,

best regards,

eb

Emmanuel Belo wrote:
> Hi,
> 
> i'm trying to set up multiple layers/classes with the plugin autolayers 
> (http://www.cartoweb.org/doc/cw3.1/xhtml/user.layers.html#user.layers.autolayer) 
> 
> 
> After some coding (very basic) it works fine, but now as i'm trying to 
> use arrays, this error message appears:
> 
> Parse error: syntax error, unexpected ']', expecting T_STRING or 
> T_VARIABLE or T_NUM_STRING in 
> C:\wamp\www\cw3_vd2006\scripts\makemaps.php(158) : eval()'d code on line 
> 223
> 
> The lines in question are:
> 
> 221 $emmanuel = array('test');
> 222 array_push($emmanuel, '1');
> 223 $emmanuel[] = '1';
> 
> array_push doesn't seem to be problematic.
> 
> Are there some coding restriction in the *.map.php?
> 
> best regards,
> 
> Emmanuel Belo
> 
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emmanuel.belo.vcf
Type: text/x-vcard
Size: 337 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/cartoweb-users/attachments/20060224/7b4f3a5b/emmanuel.belo.vcf


More information about the Cartoweb-users mailing list