05.
Fix My Deprecations
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
9 Comments
Hello! I have strange problem. I see 0 deprecations in symfony profiler. I'm 100% sure there are lots of deprecations but none of them are showing up. Do you have any idea where to look for the problem? I mean why profiler is not logging any deprecations?
Tried lots of things from stackoverflow - didn't work.
Hey @Dominik
That IS strange. Lets start from scratch. Is you PHP configured to show all errors with error_reporting config key set to E_ALL? and display errors set to true?
However another question why are you so sure that you have a lot of deprecations?
and some more questions: What is your php version? What Symfony version do you use? Is it related to course code?
Cheers
Hi,
in symfony 2.3 I used (in TWIG file):
{% set nameBundle = app.request.get('_template').get('bundle') %}
{% set nameEntity = app.request.get('_template').get('controller') %}
I try to use in 2.8/3.0 :
{% set nameBundle = app.request.attributes.get('_bundle') %}
{% set nameEntity = app.request.attributes.get('_controller') %}
but it is not the same!
what can I use for gettin the same answer?
Thank you in advance.
Oda
Hey Oda
I don't remember exactly how things were in Symfony2 but when I doubt is always handy to dump things so you can check the names of variables and more. Just do this on any twig template
{{ dump(app.request) }}Or, dump the request inside a controller's action
dump($request);Cheers!
Warning: trim() expects parameter 1 to be string, array given in symfony sir what should i do
Hi!
Do exactly what the error message says. The trim() function does not work with arrays, in dev mode look at the error page and find the line where you pass incorrect value. Try to debug why the value is an array, is it on purpose or just a simple dev misprint? If on purpose, you need to change the logic because trim() does not work with arrays. Here's the link to the docs:
http://php.net/manual/en/fu...
Cheers!
Hi,
I have the case where : @=service('doctrine.orm.default_entity_manager').getRepository('LineFringeBundle:PerformanceBookmark')
I've tried several different ways of wrapping it in quotes but with no luck. Any suggestions?
Hey claire
Have you tried using double quotes as a main wrapper? (and inside it, single quotes)
I believe you may find this article useful: https://symfony.com/doc/cur...
Cheers!
Thankyou! Should have thought of that, cheers for the advice
"Houston: no signs of life"
Start the conversation!