Skip to content

A plugin for symfony 1.4+ framework. This is multiple photo uploader using jQuery with server side image cropper.

Notifications You must be signed in to change notification settings

nashlesigon/symfony-jquery-photo-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AzulPhotoUploaderPlugin

Author: Nash Lesigon
Email: nashlesigon@gmail.com
Date Created: May 2012
Version: 1.0
Compatibility: Symfony 1.4+

Description:

This plugin gives the ability to upload multiple photos with caption, title and target link using jQuery ajax request.

Requirements:

You must have image_transform pear package installed. If you don't have it, you can download it here.

Install

1. Download package and place on the plugin directory
2. Import sql file: config/azulphotouploader.sql
3. Enable plugin in the project configuration file
4. run the ./symfony plugin:publish-asset command

How to use:

1. Add the javascript and the css file to the page where you want to use the uploader
	
	<?php use_javascript('/AzulPhotoUploaderPlugin/js/azulphotouploader-2.0a.js') ?>
	<?php use_stylesheet('/AzulPhotoUploaderPlugin/css/photouploader.css') ?>

2. Add the uploader to your template with this code:
	$("#uploader").azulphotouploader({
		context: your_image_context, // replace with your defined context
		hasTitle: true, // default value is false
		post_url: path_to_post_url // replace with your post path
	});
3. In the server side, use either of the following codes:
	a. $result = ApUploaderApi::getInstance()->saveImage();
	b. $result = ApUploaderApi::getInstance()->setFile($request->getFiles('image'))->saveImage();

Example:

<div id="uploader">
	// plugin will add the mark up here
</div>

<script type="text/javascript">
	$("#uploader").azulphotouploader({
		context: "sample", // replace with your defined context
		hasTitle: true, // default value is false
		post_url: "/photo-upload/process" // replace with your post path
	});

</script>

// And then on the server side:
$result = ApUploaderApi::getInstance()->saveImage();

About

A plugin for symfony 1.4+ framework. This is multiple photo uploader using jQuery with server side image cropper.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published