public static function _init() { static::$_properties['address']['form']['placeholder'] == __('profile.street'); }
'field_template' => "<div class=\"{error_class}\">{label}{required}{field}<small>{error_msg}</small></div>\n"
Oops. That looks like a typo...nakp wrote on Wednesday 1st of August 2012:Thank you, thats a workaround, why two == signs? I've used only one xD
Ok, I get you. If you don't have labels you need to define custom error message using the get_message() method on the validation error object. In the template you can add html surrounding {error_msg} to allow you to position them using css. To put them below the input I use a "float:left" on them and push them down a bit, but ymmv...nakp wrote on Wednesday 1st of August 2012:Labels are used for validation messages as far as I know but for some fields, I don't have labels but placeholders Error messages are supposed to be shown below inputs
// init the formdata array $formdata = array(); // ... some code here // repopulate from posted input $formdata = array_merge($formdata, \Input::post()); // and pass it to the form return \View::forge('myview', array('formdata' => $formdata));
<?php echo Form::input('fieldname', \Arr::get($formdata, 'fieldname', 'default value if not present'));so use Arr:get() to simulate CI's set_value() functionality. I would not use the Input class in your views, as input data will not be escaped like data passed to the view. This may be a security issue, and require you to escape manually, using the e() helper.
$view = View::forge('clients/add.smarty'); $view->set('data', $data, false); return $view;
It looks like you're new here. If you want to get involved, click one of these buttons!