<?php
namespace app\forms;
use Phalcon\Forms\Form,
Phalcon\Forms\Element\Select;
class RegionForm extends Form
{
public function initialize()
{
$country = new Select('country', \countries::find(), array(
'using' => array('id_num','name')
));
$this->add($country);
}
}
<? $this->forms->set('region', new app\forms\RegionForm()); ?>
<?= $this->forms->get('region')->render('country'); ?>
Result:
PHP Catchable fatal error: Object of class countries could not be converted to string in ...
Using mongodb. What I'm doing wrong??