Last active
April 18, 2019 11:38
-
-
Save factoryhr/95ce0d29ba51609b1d303aef00fb5535 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Routing\Annotation\Route; | |
use Pimcore\Model\DataObject\Brand; | |
use Pimcore\Model\DataObject\Product; | |
class BrandController extends AbstractController | |
{ | |
/** | |
* @Route("/en/brandpages/{id}", name="brand") | |
*/ | |
function detailAction(Request $request, $id) { | |
// Get brand by id | |
$brand = Brand::getById($id); | |
// Get products by brand id | |
$productList = new Product\Listing(); | |
$productList->setCondition("Brand__id = ?", $id); | |
$products = $productList->getObjects(); | |
$this->view->products = $products; | |
$this->view->brand = $brand; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blog post - Pimcore learning experience - brand detail action