PHP code example of kphoen / gaufrette-extras-bundle
1. Go to this page and download the library: Download kphoen/gaufrette-extras-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kphoen / gaufrette-extras-bundle example snippets
# app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new KPhoen\GaufretteExtrasBundle\KPhoenGaufretteExtrasBundle(),
);
}
class MyFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('avatar', 'image', array(
'gaufrette' => 'avatars',
'image_path' => 'avatar', // because there is a getAvatar() method in the data class
'image_alt' => 'Avatar',
'image_width' => '100px',
'image_height' => '100px',
'no_image_placeholder' => 'noImage.jpg',
));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.