Hi, I'm writing a new custom Element to use in Phalcon generated forms. This is my element code:
<?php
namespace MyNameSpace\MyElementLocation;
use Phalcon\Forms\Element;
class Dummy extends Element
{
public function render($attributes = null)
{
$html = '<pre>' . print_r($attributes, true) . '</pre>';
return $html;
}
}
?>
as you can see, it's only a test. To use it, I wrote this code:
<?php
// namespace and other init stuff.
class CustomElementTestForm extends Form
{
public function initialize($entity = null, $options = null)
{
$this->add(new Dummy('dummy', ['foo' => 'bar']));
}
}
?>
the problem is that the $attributes array in the custom element code contains no data, even i've used an array as function parameter in then test code ($html is always equal to '<pre></pre>')... suggestions on what I'm missing?