我想要得到的數據至極不同budnle實體: 枝杈在MainBundle:枝條上載從實體數據在不同的束
{% extends 'MainBundle:eshop:main.html.twig' %}
{% set products = getClassVars(Product) %}
{% block body %}
<div class="container main-container">
<!-- Main component call to action -->
<div id="productslider" class="owl-carousel owl-theme">
<?php $em= $this->getDoctrine()->getManager();?>
<?php $products= $em
->getRepository('ProductBundle:Product')->findAll(); ?>
{%
for product in products %}
{% if date(product.createdDate)> date('-1days') %}
<div class="item">
<div class="product">
<a class="add-fav tooltipHere" data-toggle="tooltip"
data-original-title="Add to Wishlist"
data-placement="left">
<i class="glyphicon glyphicon-heart"></i>
</a>
<div class="image">
<div class="quickview">
<a data-toggle="modal" class="btn btn-xs btn-quickview" href="ajax/product.html"
data-target="#productSetailsModalAjax">Quick View </a>
</div>
<a href="{{ asset('app_dev.php/product/')~product.id~"/show" }}"><img
class="img-responsive" alt="img"
src="{{ asset('bundles/imageproducts/')~ product.imageName }}"
height="250" width="200"></a>
<div class="promotion"><span class="discount">15% OFF</span></div>
</div>
<div class="description">
<h4>
<a href="{{ asset('app_dev.php/product/')~product.id~"/show" }}">{{ product.libelle }} </a>
</h4>
<div class="grid-description">
<p>{{ product.libelle }} </p>
</div>
<div class="list-description">
<p> {{ product.description }}</p>
</div>
<span class="size">XL/XXL/S </span></div>
<div class="price"><span>$25</span></div>
<div class="action-control"><a class="btn btn-primary"> <span class="add2cart"><i
class="glyphicon glyphicon-shopping-cart"> </i> Add to cart </span>
</a></div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endblock %}
產品實體:
<?php
namespace ProductBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToMany;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use ProductBundle\Repository\ProductRepository;
/**
* Produit
* @ORM\Entity(repositoryClass="\ProductBundle\Repository\ProductRepository")
* @Vich\Uploadable
* @ORM\Table(name="produit")
*/
class Product
{
/**
* @ORM\GeneratedValue
* @ORM\Id
* @ORM\Column(type="integer")
*/
private $id;
未知「 getClassVars「函數。
我應該怎麼做,任何幫助,請。 忽略此:khvjhvljhbvljhbljhbljhbjhbljhbjhbljhb
我改變在我的用戶控制器,控制器加載產品,其中產品在不同的包,我並不需要任何註釋由於添加了很多 –