1. Go to this page and download the library: Download crowd/ptt 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/ */
protected function listTitle()
{
return 'My new list Entity title';
}
protected function continueWithDeletion($entity)
{
if (//custom validation using $entity) {
//not valid
return array(false, 'Hey, this is an error message');
} else {
//valid
return array(true, '');
}
}
protected function beforeDeletion($entity)
{
//remove entities related to $entity
}
protected function editTitle()
{
return 'My new edit Entity title';
}
//Returns boolean indicating if the sent data is valid or not
$pttForm->isValid();
//Persists and flushes the entity
$pttForm->save();
//Returns the success message
$pttForm->getSuccessMessage();
//Returns the error message
$pttForm->getErrorMessage();
//Returns the html code for the form
$pttForm->createView();
use Crowd\PttBundle\Form\PttEntity;
class MyEntity extends PttEntity {
use Crowd\PttBundle\Form\PttTransEntity;
class MyEntityTrans extends PttTranEntity {