我有一个view views / detailedforms / view.html.php
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
class Detailed_formViewDetailedforms extends JViewLegacy {
protected $items;
protected $pagination;
protected $state;
protected $params;
protected $form;
/**
* Display the view
*/
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->state = $this->get('State');
$this->form = $this->get('Form');
var_dump($this->form);
}
和model models / forms / detailedforms.xml
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="contact" label="Detail_FORM">
<field name="name"
type="text"
id="tailor-made-name"
size="30"
description="FORM_NAME_DESC"
label="FORM_NAME_LABEL"
filter="string"
required="true"
/>
<field name="email"
type="email"
id="email"
size="30"
description="EMAIL_DESC"
label="EMAIL_LABEL"
filter="string"
validate="tailoremail"
required="true"
/>
</fieldset>
$ this-&gt; form返回null。请帮忙,如何解决问题。 由于此问题,模板文件中发生致命错误。