Re: Passing parametre
Patrick Dawkins <[email protected]> Wed, 4 Dec 2013 12:35:41 +0000
| Newsgroups | gmane.comp.php.drupal.devel |
|---|---|
| Message-ID | <CA+mdK8j0pb9DkDF2seL8ZZ3YJsPja2u3X07ucO-xPtZa3G073g@mail.gmail.com> |
--20cf303dd35818a0e704ecb4a908
Content-Type: text/plain; charset=UTF-8
night_pharmacy_table is a form submit callback. It already gets passed the
$form parameter; you have got the function signature wrong.
So you need to change
function night_pharmacy_table($form_state) {
to
function night_pharmacy_table($form, &$form_state) {
Documentation here:
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#submit_property
On 4 December 2013 12:14, Muzaffer Tolga Ozses <[email protected]> wrote:
> Hi,
>
> This is really a PHP question, but it involves $form_state, so bear with
> me please.
>
> In my code at
> http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=132b5d4a90692acfadfe9e11af128f712df1c24d;hb=e89e63bb07f064898ca21be1c97aba221b4dbdaf#l57I want to be able to pass $form parameters to night_pharmacy_table, to no
> avail. Can you help me guys?
>
> Thanks in advance :)
>
--20cf303dd35818a0e704ecb4a908
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">night_pharmacy_table is a form submit callback. It already=
gets passed the $form parameter; you have got the function signature wrong=
.<div><br></div><div><div>So you need to change<div><div>function night_pha=
rmacy_table($form_state) {</div>
<div>to</div><div>function night_pharmacy_table($form, &$form_state) {<=
/div></div></div><div><br></div><div><br></div><div>Documentation here:=C2=
=A0<a href=3D"https://api.drupal.org/api/drupal/developer!topics!forms_api_=
reference.html/7#submit_property">https://api.drupal.org/api/drupal/develop=
er!topics!forms_api_reference.html/7#submit_property</a><div>
<br></div></div><div><br></div></div></div><div class=3D"gmail_extra"><br><=
br><div class=3D"gmail_quote">On 4 December 2013 12:14, Muzaffer Tolga Ozse=
s <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank=
">[email protected]</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default=
" style=3D"font-family:'courier new',monospace">Hi,</div><div class=
=3D"gmail_default" style=3D"font-family:'courier new',monospace">
<br></div><div class=3D"gmail_default" style=3D"font-family:'courier ne=
w',monospace">
This is really a PHP question, but it involves $form_state, so bear with me=
please.</div><div class=3D"gmail_default" style=3D"font-family:'courie=
r new',monospace"><br></div><div class=3D"gmail_default" style=3D"font-=
family:'courier new',monospace">
In my code at=C2=A0<a href=3D"http://git.webciniz.im/?p=3Dproject/night_pha=
rmacy.git;a=3Dblob;f=3Dnight_pharmacy.module;h=3D132b5d4a90692acfadfe9e11af=
128f712df1c24d;hb=3De89e63bb07f064898ca21be1c97aba221b4dbdaf#l57" target=3D=
"_blank">http://git.webciniz.im/?p=3Dproject/night_pharmacy.git;a=3Dblob;f=
=3Dnight_pharmacy.module;h=3D132b5d4a90692acfadfe9e11af128f712df1c24d;hb=3D=
e89e63bb07f064898ca21be1c97aba221b4dbdaf#l57</a> I want to be able to pass =
$form parameters to night_pharmacy_table, to no avail. Can you help me guys=
?</div>
<div class=3D"gmail_default" style=3D"font-family:'courier new',mon=
ospace"><br></div><div class=3D"gmail_default" style=3D"font-family:'co=
urier new',monospace">Thanks in advance :)</div></div>
</blockquote></div><br></div>
--20cf303dd35818a0e704ecb4a908--