[php] g
Viewer
- public function ModulChildData($settings,$reportmodel,$requestdata,$moduldataxml,$model,$field,$value){
- $this->_controller->loadModel($model);
- $returnarray = $this->_controller->$model->find('first',array('conditions'=>array($model.'.id' => $value)));
- $returnarray = $returnarray [$model];
- if (isset($moduldataxml->childs)) {
- foreach ($moduldataxml->childs->value as $childkey => $childvalue) {
- $childvalue = trim($childvalue);
- $childvaluefield = Inflector::camelize($childvalue);
- $response[$reportmodel][$childvaluefield]['value'] = $returnarray [trim($childvalue)];
- if(isset($settings->$reportmodel->$childvalue->radiooption)){
- $response[$reportmodel][$childvaluefield]['value'] = trim($settings->$reportmodel->$childvalue->radiooption->value[$returnarray [trim($childvalue)]]);
- }
- }
- }
- return $response;
- }
Editor
You can edit this paste and save as new: