Have you got a more complex example code about to extends an Element ?
"In addition to the form elements provided by Phalcon you can create your own custom elements:
<?php
use Phalcon\Forms\Element;
class MyElement extends Element
{
public function render($attributes=null)
{
$html = //... produce some html
return $html;
}
}
I tried to extends an Element, when i POST the Form how to read the value posted in the render method ?
$form = new Form($model);
$form->add(new Map("latlng"));
$form->bind($_POST,$model);
class Map extends \Phalcon\Forms\Element {
public function render($attributes=null)
{
$html = "" //... produce some html
$html .= Tag::hiddenField(array($this->getName(), "value" => $this->getValue()));
....
return $html;
}
}
$this->getValue(); IS EMPTY, NO VALUE FROM THE POST and how to add the attributes ?