Mam takie pytanie jaką komendą stworzyć nową encje, żeby potem mógł operowac na tym obiekcie tak jak w laravelu bo taką encje mam stworzoną i jest w katalogu ./src/Entity tylko, stworzenie bazy danych z tymi tabelami przez symfony już się nie powiodło był tylko komunikat, że nie ma nic do roboty i tabel stworzyłem ręcznie
Ten kod zwraca mi
Class 'AppBundle\Controller\Users' does not exist
<?php
namespace AppBundle\Controller;
use AppBundle\Entity\Task;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use AppBundle\Entity\User;
//use Symfony\Component\HttpFoundation\Request;
class InstallController extends Controller
{
/**
* @Route("/", name="homepage")
*/
public function indexAction(Request $request)
{
$es = $this->getDoctrine()->getManager();
$s = $es->getRepository(Users::class)->findAll();
return $this->render('install/index.html.twig',["s" => $s]);
//return $this->render('install/index.html.twig');
// replace this example code with whatever you need
//return $this->render("");
//return $this->render('default/index.html.twig', [
//'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,
//]);
}
public function submitAction() {
$product = new User();
$product->setName('A Foo Bar');
$product->setPrice('19.99');
$product->setDescription('Lorem ipsum dolor');
$em = $this->getDoctrine()->getManager();
$em->persist($product);
$em->flush();
return $this->render('admin/index.html.twig',[
'login' => $_POST["login"],
]);
//print $input->getArgument('login');
}
}
Jestem kompletnie zielony jeżeli chodzi o symfony.