-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-3035 [Twig] Allowed passing parameters to ibexa render function
#674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.6
Are you sure you want to change the base?
IBX-3035 [Twig] Allowed passing parameters to ibexa render function
#674
Conversation
1bb7be8 to
2a1ab1c
Compare
ibexa render function
099a520 to
a0ddb17
Compare
a0ddb17 to
988d77f
Compare
ibexa render functionibexa render function
|
@vidarl please make sure all the suggestions are adressed, CI lits green and the PR is rebased. |
3c65ba0 to
5e212bb
Compare
tests/lib/MVC/Symfony/Templating/ForwardParamOptionsToFragmentRendererTrait.php
Outdated
Show resolved
Hide resolved
tests/lib/MVC/Symfony/Templating/ForwardParamOptionsToFragmentRendererTrait.php
Outdated
Show resolved
Hide resolved
tests/lib/MVC/Symfony/Templating/ForwardParamOptionsToFragmentRendererTrait.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
266a88e to
00e2b90
Compare
|
@konradoboza, @alongosz , @mikadamczyk : This is now done |
konradoboza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more minor things:
| * @param \Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface|\PHPUnit\Framework\MockObject\MockObject $fragmentRendererMock | ||
| * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject|\PHPUnit\Framework\MockObject\MockObject $valueObjectMock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @param \Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface|\PHPUnit\Framework\MockObject\MockObject $fragmentRendererMock | |
| * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject|\PHPUnit\Framework\MockObject\MockObject $valueObjectMock | |
| * @param \Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface&\PHPUnit\Framework\MockObject\MockObject $fragmentRendererMock | |
| * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject&\PHPUnit\Framework\MockObject\MockObject $valueObjectMock |
| ); | ||
|
|
||
| /** @var \Ibexa\Contracts\Core\Repository\Values\ValueObject&\PHPUnit\Framework\MockObject\MockObject $valueObjectMock */ | ||
| TestCase::assertTrue($renderContentStrategy->supports($valueObjectMock)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| TestCase::assertTrue($renderContentStrategy->supports($valueObjectMock)); | |
| self::assertTrue($renderContentStrategy->supports($valueObjectMock)); |
| /** @var \Ibexa\Contracts\Core\Repository\Values\ValueObject&\PHPUnit\Framework\MockObject\MockObject $valueObjectMock */ | ||
| TestCase::assertTrue($renderContentStrategy->supports($valueObjectMock)); | ||
|
|
||
| TestCase::assertSame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| TestCase::assertSame( | |
| self::assertSame( |
| /** @var string|null */ | ||
| private $rendered; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While on it - can we have a strict type here? We hardly skip typing when introducing a new code unless there is a good reason to put mixed.
| /** @var string|null */ | |
| private $rendered; | |
| private ?string $rendered; |
|
|
||
| return $controllerReference->attributes['params'] === $params; | ||
| }), | ||
| self::anything(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either change the assertion or drop it entirely.
| self::anything(), |



Description:
When using
render(controller('ibexa_content::viewAction')), you can send parameters to the controller which will be available in the template.Example:
This PR adds the same possibility when using
ibexa_render():For QA:
Documentation: