Php Joomla$this->;get(';Form';)返回NULL
我有一个视图views/detailedforms/view.html.phpPhp Joomla$this->;get(';Form';)返回NULL,php,joomla,Php,Joomla,我有一个视图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; p
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->form返回null。请帮助,如何解决此问题。
由于此问题,模板文件中出现致命错误。请尝试在$this->get('Form')上询问您的问题;php意味着它调用模型的函数(models/detailedforms.php)。分享你的模型,了解你缺少了什么?谢谢你的帖子,模型中没有定义表单函数。我的问题解决了。