[Cartoweb-users] Retrieving a Smarty Variable from cartoclient.tpl and writing its contents to a html file

Max Ueda mhanzo at yahoo.com
Mon Nov 13 05:34:06 EST 2006


Oliver,

Yes, it seems more reasonable to do that way (the one
you suggested), since I've seen that this issue has
not been solved yet (I found some Smarty discussions
regarding this, and even at their official FAQ
session, this question is unanswered).

I'll try it, and as soon as I get it running, I'll
post the results!

Thank you!



--- Oliver Christen <oliver.christen at camptocamp.com>
wrote:

> Why dont you extend the table plugin ? So you could
> act directly where the 
> table_result is generated and you could have better
> control on the php code 
> than inside a smarty template.
> 
> to extend a plugin, you simply have to create a new
> php file, named for 
> exemple ClientMyProjectTables.php and containing:
> 
> <?php
> /**
>  * @package CorePlugins
>  * @version $Id: ClientMyProjectTables.php,v 1.8
> 2005/02/23 11:52:43 johndoe 
> Exp $
>  */
> 
> class ClientMyProjectTables extends ClientTables {
> 
>     public function replacePlugin() {
>         return 'tables';
>     }
> 
>     /* Add or overload methods here */
> 
> }
> ?>to know where to add your piece of code writing
> your messagem.html file, 
> refer to the flow diagram 
>
(http://www.cartoweb.org/doc/misc/plugins_diagram.pdf
> (yes the quality is 
> low, I need to redo it))If you want to have exactly
> the same result object 
> as in the normal table output, you will have to do
> it in function renderForm 
> or after, like this:    public function
> renderForm(Smarty $template) 
> {       $tablesResult = $this->renderFormPrepare(); 
>      $file = 
> fopen("messagem.html","w"); // maybe you will have
> to check the path to this 
> file       $tag1=
> "<html><head><title></title></head><body>"; 
> $tag2="</body></html>";       fwrite($file,$tag1);  
>     fwrite($file, 
> $tablesResult);       fwrite($file, $tag2);      
> fclose($file); 
> parent::renderForm($template);   }
> 



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com


More information about the Cartoweb-users mailing list