I have two questions...
- I use this for photos upload:
$file->moveTo('upload/objects/'.md5($objects->id).'0'.$ext);
$image = new Phalcon\Image\Adapter\GD('upload/objects/'.md5($objects->id).'0'.$ext);
$image->resize(500, 500);
$objects->object_photo0 = ''.md5($objects->id).'0'.$ext;
And now, I want to create 2 photos : the first one is in the above code, the normal photo, and now i want to create thumbnail like this:
$file->moveTo('upload/objects/thumbs/'.md5($objects->id).'0'.$ext);
$image = new Phalcon\Image\Adapter\GD('upload/objects/thumbs/'.md5($objects->id).'0'.$ext);
$image->resize(500, 500)->crop(500,500);
$objects->thumb_photo0 = ''.md5($objects->id).'0'.$ext;
How do I do this all together in one action?
- I have one action and i use it from two places. How can I determine from which action did the user come from, and redirect it to different page? Example: User comes from page A to controller, controller redirects it to page C. Also, user comes from B page to sme controller, controller redirects it to page D ?