Example #1
0
 * @package    Events
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
$attributes = array('enctype' => 'multipart/form-data');
if ($ajaxify) {
    //	$attributes['class'] = 'ajaxify';
    $cancel_attributes = array('class' => 'ajaxify');
} else {
    $cancel_attributes = null;
}
echo Form::open(null, $attributes);
?>

	<fieldset>
		<ul>
			<?php 
echo Form::file_wrap('file', null, __('Image'), $errors);
?>
		</ul>
	</fieldset>

	<fieldset>
		<?php 
echo Form::submit_wrap('save', __('Upload'), null, $cancel, $cancel_attributes);
?>
	</fieldset>

<?php 
echo Form::close();
Example #2
0
 * Multiple upload form
 *
 * @package    Anhq
 * @author     Antti Qvickström
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
echo Form::open(Arr::get($form, 'action'), array('id' => 'form-multiple-upload', 'method' => 'post', 'enctype' => 'multipart/form-data'));
$field_id = 'field-' . Arr::path($form, 'field.name', 'file');
$field_name = Arr::path($form, 'field.name', 'file') . '[]';
?>

	<fieldset>
		<ul>
			<?php 
echo Form::file_wrap($field_name, array('id' => $field_id, 'multiple' => 'multiple'), null, null, __('Allowed image types: :types, maximum image size: :size', array(':types' => implode(', ', Kohana::config('image.filetypes')), ':size' => Kohana::config('image.filesize'))));
?>
		</ul>
	</fieldset>

	<fieldset>

		<?php 
echo Form::csrf();
?>
		<?php 
echo Form::submit_wrap('save', __('Upload'), null, Arr::get($form, 'cancel'), null, Arr::get($form, 'hidden'));
?>

	</fieldset>
Example #3
0
<?php

echo Form::file_wrap($name, $attributes + Form::attributes($field), isset($label) ? $label : '', isset($errors) ? $errors : '', isset($tip) ? $tip : '');