【发布时间】:2015-01-13 10:39:52
【问题描述】:
尝试创建新表单元素时出现此错误:
Phalcon\Forms\FileUpload::render() 的声明必须与 Phalcon\Forms\ElementInterface::render() 的声明兼容
这是我的代码:
namespace Phalcon\Forms;
class FileUpload extends Element implements ElementInterface
{
public function __construct(string $name, $options, array $attributes)
{
}
public function render(array $attributes)
{
return 'my form element html';
}
}
此时我已经尝试了所有不同的参数表示法,但仍然收到相同的错误。
所以我想知道是否有可能在 Phalcon 中创建这样的表单元素,或者这只是我在文档中遗漏的内容。
http://phalcon.agent-j.ru/en/1.3.0/Phalcon/Forms/Element/
http://docs.phalconphp.com/en/latest/api/Phalcon_Forms_ElementInterface.html
我使用的是 1.3.2 版
【问题讨论】: