Poniżej znajduje się ściągawka dla uczestników warsztatu
W poniższej instrukcji występują zwroty
- wiersz poleceń
- terminal
- konsola
<?php | |
writeln("all input data are correct, so all asserts should return true, right?"); | |
assertTwoFloats(20000 / 10000 - 1, 1); | |
assertTwoFloats(14700 / 10000 - 1, 0.47); | |
writeln("those don't:"); | |
assertTwoFloats(14600 / 10000 - 1, 0.46); |
Create Util class for your entity, in my case entity is called 'Brand'
src/KP/Brand/MainBundle/Util/BrandUtil.php
<?php
namespace KP\Brand\MainBundle\Util;
use KP\Brand\MainBundle\Entity\Brand;
<?php | |
private function getErrorMessages(\Symfony\Component\Form\Form $form) { | |
$errors = array(); | |
if ($form->hasChildren()) { | |
foreach ($form->getChildren() as $child) { | |
if (!$child->isValid()) { | |
$errors[$child->getName()] = $this->getErrorMessages($child); | |
} |
backend_new_user: | |
pattern: /admin/new-user/{username}/{password}/{email} |
imports: | |
- { resource: config_dev.yml } | |
framework: | |
test: ~ | |
session: | |
storage_id: session.storage.mock_file | |
web_profiler: | |
toolbar: false |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
<?php | |
namespace KP\MainBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
/** | |
* Class AbstractController | |
* | |
* @package KP\MainBundle\Controller |