How to pass data to partial

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
jramirezgranada
Posts: 40
Joined: 12 Jul 2018, 19:57

How to pass data to partial

Post by jramirezgranada » 10 Aug 2018, 21:29

Laravel: 5.6
Aimeos: 2018.04
PHP: 7.x

Hi there;

In the product detail I need to send a new variable to price-standard.php, I have to show some additional data that is coming from a hidden attibute.
I tried this but it doesn't work

Code: Select all

<?= $this->partial(
       $this->config( 'client/html/common/partials/price', 'common/partials/price-standard.php' ),
        array( 'pricess' => $this->detailProductItem->getRefItems( 'price', null, 'default' ), 'myVal' => 'Test' )
); ?>
Where myVal should be the new variable that I need to render in the price-standard.php

How can I get it working ??

Thanks.
--
Jorge A Ramirez
System Engineer
PHP Developer

User avatar
aimeos
Administrator
Posts: 7892
Joined: 01 Jan 1970, 00:00

Re: How to pass data to partial

Post by aimeos » 11 Aug 2018, 15:40

This should work as you say. In the price partial you should have access to:

Code: Select all

print_r( $this->pricess  );
echo $this->myVal;
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply