Hi,
I've created a new form element 'url' for the html-element <input type="url" ...>.
class Url extends Element
{
public function __construct($name, $attributes=null)
{
parent::__construct($name, $attributes);
}
public function render($attributes = null)
{
if ($attributes != null && is_array($attributes))
{
foreach ($attributes as $new_attr => $value)
{
$this->_attributes[$new_attr] = $value;
}
}
$html = '<input type="url" ';
foreach ($this->_attributes as $attr => $value)
{
$html .= $attr.'="'.$value.'" ';
}
$html .= ' />';
return $html;
}
}
Creating and updating works fine, but it does not show (or bind) the data to the edit-form from the loaded entity.
$note = EntitiesNotes::findFirstById($id);
$form = new NoteForm($note);
All standard elements that come with phalcon shows the stored data, but the url-field is empty. Rendered HTML-Code shows that the input has no value="" attribute.
Do I have to override another function of the Form\Element?
Thanks alot!