1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 498 Views |
-
Noob Form question

5 March 2011 at 6:36am
Hi,
I'm pretty sure this is very simple and I'm doing this horriblely wrong or something.
What I'm try to do , Is that i have a form that submits an image.
it then crops bits of the image into new images , i want to display these as the return of the submission of the form.what I'm not sure of how do do is to pass the paths to the images i have created to the template.
Any help would be cool -
Re: Noob Form question

6 March 2011 at 11:20pm Last edited: 6 March 2011 11:20pm
What I'm try to do , Is that i have a form that submits an image.
it then crops bits of the image into new images , i want to display these as the return of the submission of the form.first part is with SimpleImageField or Uploadify, no idea about splitting the image up...
what I'm not sure of how do do is to pass the paths to the images i have created to the template.
You can pass data into a template in many ways, is this data written to the database? If so place...function CroppedImages() {
return DataObject::get('MyCroppedImages');
}if it isn't then simply place your data into the same structure manually...
function CroppedImages() {
$arr = array('data1','data2');
$dos= new DataObjectSet();
foreach ($arr as $str) {
$do= new DataObject();
$do->ImageName = $str;
$dos->push($do);
}
return $dos;
} -
Re: Noob Form question

9 March 2011 at 8:24am
Thanks swaiba for your reply.
The area I'm really having problems with is the flow of returning a page after a form has been submitted.
I'm not using a database , so the DataObjectSet is what i want alright thanks.The code I have so far returns a blank page:
http://www.sspaste.com/paste/show/4d7674ab061a7myTemplate is just : <h1>hello</h1>
after that, My problem now is accessing the DataObjectSet from the template, maybe a control loop , but not sure how to access arrays in the template language.
| 498 Views | ||
|
Page:
1
|
Go to Top |


