Thursday, January 17, 2013

Re: Save Uploaded/Parsed File to Database Table

On Wed, Jan 16, 2013 at 5:37 PM, Karl Smith <barnunboi@hotmail.com> wrote:
>
>
>>
>> > Now as far as my view goes..do I need to add an input for user_id and
>> > coverage_id as hidden fields?
>>
>> The user_id you can add manually after the upload with
>> $this->Auth->user('id') but for coverage_id you can either use a
>> hidden form field or add that data to the array before saving as well.
>> Either way, you'll need to know what the coverage_id is so you should
>> pass it to the action in the first place:
>>
>> echo $this->Html->link(
>> 'upload spreadsheet',
>> array(
>> 'controller' => 'Coverages',
>> 'action' => 'processSpreadsheet',
>> 'coverage_id' => $xxx
>> )
>> );
>>
> Ok...I have a quick question....is there another way to pass the coverage_id
> beside the code listed above. I need to pass the coverage_id but I don't
> need a hyperlink.

Well, the link is just an example. How does the user arrive at the
upload form? Whichever way you choose, you're going to have to pass
$coverage_id to your action somehow.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.

No comments: