CodeIgniter Forums
Form Generation Library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Form Generation Library (/showthread.php?tid=16439)



Form Generation Library - El Forum - 12-13-2009

[eluser]macigniter[/eluser]
[quote author="CtheB" date="1260724749"]
When i replace $action with $this->action, everything works oke.

I'm using the 0.22 pre release version.[/quote]

Thanks, you just found a bug ;-) Actually that bug is only related to the pre-release version. I'll change it for the next "real" version!


Form Generation Library - El Forum - 12-13-2009

[eluser]macigniter[/eluser]
[quote author="happydude" date="1260590521"]
BTW, the split() function you used breaks in PHP 5.3. I just get deprecated messages all over. This PHP 5.3 is something else. Its just breaking things all over the world. I'm gonna change it to explode() and see if it works.[/quote]

This is fixed in the new pre-release version. You can download it here.


Form Generation Library - El Forum - 12-14-2009

[eluser]happydude[/eluser]
I need help urgently.

I have been trying to upload files using upload() and iupload().

The file uploads to the folder but its data is not sent to the $_POST array. I enable profiler, all other $_POST data shows up except $_POST['userfile'].

Thanks in advance...


Form Generation Library - El Forum - 12-14-2009

[eluser]hugle[/eluser]
[quote author="happydude" date="1260842612"]I need help urgently.

I have been trying to upload files using upload() and iupload().

The file uploads to the folder but its data is not sent to the $_POST array. I enable profiler, all other $_POST data shows up except $_POST['userfile'].

Thanks in advance...[/quote]

Hello,
Have you downloaded the 0.22 version?

give a try:
Code:
if ($this->form->valid)
        {
            $post = $this->form->get_post();
}
this $post should contain uploaded data...
If not (i'm not sure if it was fixed with 0.22 version)
Use a model insead, and then your userfile will be available in:
$data
Smile


Form Generation Library - El Forum - 12-14-2009

[eluser]macigniter[/eluser]
[quote author="happydude" date="1260842612"]I need help urgently.

I have been trying to upload files using upload() and iupload().

The file uploads to the folder but its data is not sent to the $_POST array. I enable profiler, all other $_POST data shows up except $_POST['userfile'].

Thanks in advance...[/quote]

Please check the $_FILES var instead of $_POST.

It's much easier to use the library's $this->form->get_post() method which will return your file data like

Code:
$data = $this->form->get_post();

print_r($data['file']);



Form Generation Library - El Forum - 12-14-2009

[eluser]dinhtrung[/eluser]
@macigniter : How about my patch for multiple models support? I didn't seen it in the pre-release version. I think this feature is neccessary, if your application use HMVC or Modular Separation.


Form Generation Library - El Forum - 12-15-2009

[eluser]hugle[/eluser]
[quote author="dinhtrung" date="1260868038"]@macigniter : How about my patch for multiple models support? I didn't seen it in the pre-release version. I think this feature is neccessary, if your application use HMVC or Modular Separation.[/quote]

+1 for this


Form Generation Library - El Forum - 12-15-2009

[eluser]happydude[/eluser]
I noticed that you have changed the split function to explode in 0.22 but i have not had time to test it.

When I changed it to explode myself manually in 0.20, The onsuccess function was asking for arrays as the second argument and was throwing errors when string was sent. I know it should be string|array but it was not accepting string. I had to send values in as an array.

Please check this.


Form Generation Library - El Forum - 12-15-2009

[eluser]happydude[/eluser]
*** EDIT ****

Don't worry about this one, I changed $action to $this->action like somebody did earlier.

____________________________________________


This new prerelease gives me an error:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: action

Filename: libraries/Form.php

Line Number: 1521


Form Generation Library - El Forum - 12-15-2009

[eluser]happydude[/eluser]
Does Form::get_post() automatically trim and xss_clean data?

I'd like to know because I'll start writing documentation for the remaining parts tommorow.