Hello, I try to view my template to address:
I have this error
RuntimeException: The autoloader expected class "Sonata \ AdminBundle \ Validator \ Constraints \ InlineConstraint" to be defined in file The file was found purpose the class was not in it, the class name or namespace probably HAS typo.
my ProductRendrerer
public function renderDescription (Product $ product)
{
return $ this-> minify ($ this-> render ('edsPbBundle: ProductRendererController: description2.html.twig', array ('product' => $ product)));
}
My ProductRendererController:
<? php
namespace eds \ PbBundle \ Controller;
use eds \ PbBundle \ Renderers \ ProductRenderer;
use Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller;
use Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route;
use Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Template;
/ / I include the namespace product.php
use eds \ PbBundle \ Entity \ Product;
use eds \ PbBundle \ Entity \ DescriptionBlock;
use Symfony \ Component \ HttpFoundation \ Response;
ProductRendererController class extends Controller
{
/ **
* @ Return ProductRenderer
* /
getProductRenderer private function ()
{
return $ this-> container-> get ("eds.pb.product_renderer");
}
public function descriptionAction ($ id_product)
{
$ repository = $ this-> getDoctrine ()
-> GetManager ()
-> getRepository ('edsPbBundle: Product');
$ product = $ repository-> find ($ id_product);
if (null == $ product) {
throw $ this-> createNotFoundException ('Product [id ='.. $ id_product '] does not exist.');
}
return new Response ($ this-> getProductRenderer () -> renderDescription ($ product));
}
}