PHP code example of simplethings / form-extra-bundle
1. Go to this page and download the library: Download simplethings/form-extra-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/ */
simplethings / form-extra-bundle example snippets
php
public function registerBundles()
{
// ...
new SimpleThings\FormExtraBundle\SimpleThingsFormExtraBundle(),
// ...
}
php
class Document
{
// temporary field, used in the form, to move new attachments to persistence
private $newAttachment;
// persistent array with all attachments.
private $attachments;
public function getNewAttachment()
{
$files = array();
foreach ($this->attachments AS $attachment) {
$files[] = $attachment->getFilename();
}
return $files;
}
public function setNewAttachment(File $newAttachment = null)
{
$this->newAttachment = $newAttachment;
}
public function moveNewAttachment()
{
// code to move file and