Hi Aileen,
 
by 'passing a variable from php to a map file' you mean writing some parameters to the mapfile before usage (like database connetions parameters) or  modifying the mapfile object on the fly to imediat usage?
 
To write parameters you can use the install script function, change your mapfile extension to .map.in and add the variables replacement tags @YOUR_VARIABLE@ where they are needed. After that set a configuration file containing the variable replacement values. Then you just need to do a cw3setup.php --install --config-from-file path_to_and_name_of_the_config_file
 
If you need to modify the mapfile object on the fly, you can have a look at the plugin Outline, in ServerOutline.php
 
$msMapObj = $this->serverContext->getMapObj(); this will get you the map object
then its just a question of using phpmapscript functions and properties: http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/referencemanual-all-pages
 
there are some exemple of usage in ServerOutline.php to access, create, modify and remove elements (layers, style, class, ... )
 
Regards
Oliver
----- Original Message -----
Sent: Thursday, May 11, 2006 11:46 AM
Subject: [Cartoweb-users] passing a variable from php to map file

Hi,
 
We are having trouble passing a variable from php to a map file.
 
How do you declare this in php?
How do you catch this in the map file?
 
We want to pass the "source_id" & "target_id" to the mapfile?
we are still on the R&D stage and we are trying to customize the demoPlugin but with our data?
 
Any help will be much appreciated.
 
 
Aileen


_______________________________________________
Cartoweb-users mailing list
[email protected]
http://lists.maptools.org/mailman/listinfo/cartoweb-users
_______________________________________________
Cartoweb-users mailing list
[email protected]
http://lists.maptools.org/mailman/listinfo/cartoweb-users

Reply via email to