Wie übergeben Sie Variablen vom controller zum view joomla mvc
Wie gebe ich meine variable aus joomla sub-controller, um die Ansicht nach diesem Beispiel
class MYControllerControllerParser extends JController{
public function __construct($default = array()) {
parent::__construct($default);
}
protected function _import($file, $type) {
$layout = '';
switch ($type) {
case 'importcsv':
$contains_headers = false;
$field_separator = JRequest::getVar('separator');
$field_separator = empty($field_separator) ? ',' : $field_separator;
$field_enclosure = JRequest::getVar('enclosure');;
$field_enclosure = empty($field_enclosure) ? '"' : $field_enclosure;
//this variable should be passed to the view
$this->info = $this->getImportInfoCSV($file, contains_headers, $field_separator, $field_enclosure);
//This variable should go to view
$this->file = basename($file);
$layout = 'importcsv';
break;
}
$this->getView('import','html')->display();
}
}
Du musst angemeldet sein, um einen Kommentar abzugeben.
Controller:
Im Blick:
$this->myVariable
da layout ist Teil einer AnsichtNotice: Undefined property: HostingViewHost::$myVariable