[TYPO3-mvc] Data Flow problems from Fluid to Domain Model Class
Frank Mey
frank.mey at eleveneyes.de
Wed Feb 24 11:05:09 CET 2010
Hi,
I got the following situation:
I injected a PHPExcel-object into my Domain-Model-Class and now want to
pass the user some functionality in the frontend. Ofc I used FLUID for it,
so I had my model class instanciated into the right controller and i.e.
did a
<f:link.action> - Link where the user can start a statistics evaluation
process with a
download link to a PHPExcel-generated Excel file being created after the
user has hit
the start-link. So far so good :)...
Now I want to let the user decide in a dropdown-selection for which time
he wants the
statistics data being generated. Thus I used the <f:form> and
<f:form.select> ViewHelpers to
get values for a property of the Domain Model Class. As I am relatively
new to the MVC object,
I don't know how to handle the submitted form data in the corresponding
controller action.
I studied the blog example project, but I dont have the situation where
I have database objects and stuff.
I only have an in-memory PHPExcel-Object I pass data to. How would this
be achieved then ?
My current controller-class looks something like this :
class Tx_StatisticsInterface_Controller_ExcelSheetController extends
Tx_Extbase_MVC_Controller_ActionController {
protected $dataSheet;
public function initializeAction() {
$this->dataSheet =
t3lib_div::makeInstance('Tx_StatisticsInterface_Domain_Model_ExcelSheet');
}
/**
* create action
* @param Tx_StatisticsInterface_Domain_Model_ExcelSheet $dataSheet
* @dontvalidate $dataSheet
*/
public function createAction() {
$this->dataSheet->getSheetData();
// $this->dataSheet->setZeitraum(<POST value of the selection box>);
$this->view->assign('datasheet',$this->dataSheet);
}
I know, the instanciating of the Model class isnt that correct, but I
always get an error when I try to instanciate the class in the createAction
saying invalid property type PHPExcel. I think it's because of the
Tx_StatisticsInterface_Domain_Model_ExcelSheet instanciating the
PHPExcel object in its constructor...
I would really apprecheate any tipps & comments as I would like to
support the MVC/extbase approach for TYPO3 in the future.
Mit freundlichen Gruessen
Best regards
--
Frank Mey
B.Eng. Medienproduktion und -technik
(new media)
More information about the TYPO3-project-typo3v4mvc
mailing list