[TYPO3-mvc] Rendering a picture

Xavier Perseguers typo3 at perseguers.ch
Sun Jun 14 17:04:55 CEST 2009


Hi,

Sorry if this question was already answered but I did not find it. It's 
a bit related to the vCard question from Susanne.

I try to use EXT:sav_jpgraph to render graphs. Basically, this extension 
just provide the well-known graph library jpgraph.

my setup is as this (relevant part):

-- index.html --

<p><f:link.action action="show">Show a graph</f:link.action></p>
<img src="{f:uri.action(action='show')}" />


-- ext_tables.php --

Tx_Extbase_Utility_Plugin::registerPlugin(
     'MyGraphExt',
     'Pi1',
     'Graphs',
     array(
         'Graph' => 'index,show',
     ),
     array(
         'Graph' => 'show',
     )
);


-- GraphController.php --

public function showAction() {
     $this->view = NULL;
		
     include t3lib_extMgm::extPath('sav_jpgraph') . 'src/jpgraph.php';
     include t3lib_extMgm::extPath('sav_jpgraph') . 'src/jpgraph_line.php';
	
     $graph = new Graph(300, 200, 'auto');	

     // stuff to create graph

     // Fix bug http://forge.typo3.org/issues/show/3540
     ob_clean();

     // Render the graph
     $graph->Stroke();
}

Questions:

1) The view is rendered only once, I get the text "show graph" only 
after a FE clear, when I refresh the page, it is empty until I clear 
again the cache. If I set the no-cache parameter on the page, this does 
not work better. This is a real problem and the only way I found to 
prevent this is to use Christian Müller's id to use a eID and 
instantiate Extbase myself. It is not really nice.

2) Action "show" renders the whole page, I have to add an "exit" 
statement after $graph->Stroke(); to prevent this. Is there another 
"official" solution?

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-typo3v4mvc mailing list