<div>Hi BIll,</div>
<div> </div>
<div>I was going to reply straight off the bat and suggest that this cannot be done, because at one point, early in my Chameleon experience, I wanted to this... BUT I had a thought...</div>
<div> </div>
<div>I believe it IS possible to read in a template from a URL. Might be risky ... but I think it's possible. If you read in a template in this way it is processed by the web server before passed along, which means PHP gets in there. You'd have to read in the template and save it as a file though I think. I have an example where I did this with a remote context document, but I havn't tried with remote templates. I'd like my templates to be predictable.
</div>
<div> </div>
<div>There also might be path issues I havn't thought of yet...</div>
<div> </div>
<div>All of this pointing and saving of a remote file would happen in the index.phtml file that calls chameleon.</div>
<div> </div>
<div>Sample:</div>
<div><font face="courier new,monospace">//$szURL is a url of a context document in this case</font></div>
<div><font face="courier new,monospace">if (isset($szURL)) {<br> $aszFile = file( $szURL );<br> $szContext = tempnam($_SESSION['gszTmpPath'], "context").".cml"; <br> $fh = fopen($szContext, "w");
<br> $nLines = count($aszFile); <br> for($i=0; $i<$nLines; $i++) {<br> fwrite($fh, $aszFile[$i]);<br> }<br> fclose($fh);<br>}</font></div>
<div> </div>
<div><font face="courier new,monospace">$oApp->moMapSession->oMap->loadMapContext( $szContext );</font></div>
<div> </div>
<div>Depending on what you want to build dynamically into your template...building a simple widget is actually not as bad as it might seem....<br><br>Cheers,</div>
<div>Liz Godwin<br><br><span class="gmail_quote">PS. Sorry if you get this twice Bill, I forgot to reply to the list as well.</span></div>
<div><span class="gmail_quote"></span> </div>
<div><span class="gmail_quote">On 5/19/05, <b class="gmail_sendername">Bill Binko</b> <<a href="mailto:bill@binko.net">bill@binko.net</a>> wrote:</span></div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Ok, I'm going to show my cluelessness here for a minute.<br><br>I'm looking to integrate map elements into pages that already include PHP
<br>code.<br><br>I understand the goal of separating the markup and the logic, but I would<br>like to embed widgets in pages that are dynamically created, and the<br>systems they work with don't have a Tag-based abstraction layer.
<br><br>Is there a way to do this? Is there a way to setup Chameleon so that<br>after it has done it's processing it feeds the results back into PHP to<br>execute? Or perhaps the opposite (PHP first, then Chameleon)? I think I
<br>can manage with either of those solutions.<br><br>If not, I will have to encapsulate all of that existing logic into<br>Chameleon widgets (and I'm not sure I can consolidate it as well as I'd<br>need to. That is, I'd have many widgets that had to cooperate.
<br><br>Any pointers for a newbie would be appreciated.<br><br>Bill<br>_______________________________________________<br>Chameleon mailing list<br><a href="mailto:Chameleon@lists.maptools.org">Chameleon@lists.maptools.org
</a><br><a href="http://lists.maptools.org/mailman/listinfo/chameleon">http://lists.maptools.org/mailman/listinfo/chameleon</a><br></blockquote></div><br>