1. Go to this page and download the library: Download makraz/ux-vvvebjs 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/ */
makraz / ux-vvvebjs example snippets
use Makraz\VvvebJsBundle\Form\VvvebJsType;
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('content', VvvebJsType::class)
;
}
use Makraz\VvvebJsBundle\Form\VvvebJsType;
use Makraz\VvvebJsBundle\DTO\Enums\VvvebJsComponentGroup;
$builder->add('content', VvvebJsType::class, [
'vvvebjs_components' => [
VvvebJsComponentGroup::COMMON,
VvvebJsComponentGroup::BOOTSTRAP5,
VvvebJsComponentGroup::EMBEDS,
],
]);
use Makraz\VvvebJsBundle\Form\VvvebJsAdminField;
public function configureFields(string $pageName): iterable
{
yield VvvebJsAdminField::new('content');
}
use Makraz\VvvebJsBundle\Upload\UploadHandlerInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
class MyUploadHandler implements UploadHandlerInterface
{
public function upload(UploadedFile $file): string
{
// Your upload logic here
// Return the public URL of the uploaded file
return 'https://example.com/path/to/file.jpg';
}
}