سؤال

I'm using the Form Helper in Lithium and wonder how to add the HTML attributes class and id to the output of $this->form->create();? I want to set these attributes on the form element.

هل كانت مفيدة؟

المحلول

As intuitive as $this->form->create(null, ['class' => 'foo', 'id' => 'bar'])

NB: replace null with $something if you are binding an object to the form.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top