public function __construct(array $config = array())
{
$self =& $this;
$defaults = array('base' => array(), 'text' => array(), 'textarea' => array(), 'select' => array('multiple' => false), 'attributes' => array('id' => function ($method, $name, $options) use(&$self) {
if (in_array($method, array('create', 'end', 'label', 'error'))) {
return;
}
if (!$name || $method == 'hidden' && $name == '_method') {
return;
}
return 'foo';
// $info = $self->binding($name);
// $model = $info->class;
// $id = Inflector::camelize(Inflector::slug($info->name));
// return $model ? basename(str_replace('\\', '/', $model)) . $id : $id;
}, 'name' => function ($method, $name, $options) {
if (!strpos($name, '.')) {
return $name;
}
$name = explode('.', $name);
$first = array_shift($name);
return $first . '[' . join('][', $name) . ']';
}));
parent::__construct(Set::merge($defaults, $config));
}