Open netbull opened 4 years ago
i am also concerned
same here, will at least the dependencies updated for symfony5?
I don't think so...you will need to look out for the forks and replace this bundles with your preferred fork to get an update
I tried start to refactor (huge pain for 2 hours), then i go over to forget this bundle and write a twig extension for my application and easily readout the server params (same like mobiledetection dependency does for mobile detection) so for me this is huge overhead and from the codebase it consume more time to refactor this. Maybe its easier to write a new Bundle.
@pwnyprod I don't know exactly what you refactored, but I forked the bundle as well and it took an hour or so and it works just fine with Symfony 4.4.x netbull/mobile-detect-bundle
@netbull i use Symfony 5.0.x
So lets question if @suncat2000 would give you the official branch.
Seems like https://github.com/tattali/MobileDetectBundle is a good updated alternative, based on this repo!
Note that https://github.com/tattali/MobileDetectBundle cannot be installed with composer require tattali/MobileDetectBundle
:
[InvalidArgumentException] Package tattali/MobileDetectBundle not found
because its not on packagist, you have to add a vcs link in you package.json but anyway this is getting more and more outdated. A good alternative is https://github.com/Gregwar/ImageBundle
because its not on packagist, you have to add a vcs link in you package.json but anyway this is getting more and more outdated. A good alternative is https://github.com/Gregwar/ImageBundle
How image bundle is related with mobile detect?
oh nvm :D too many projects, it was the wrong thread 🦩
Note that https://github.com/tattali/MobileDetectBundle cannot be installed with
composer require tattali/MobileDetectBundle
:[InvalidArgumentException] Package tattali/MobileDetectBundle not found
You should install it with composer require tattali/mobile-detect-bundle
(see https://packagist.org/packages/tattali/mobile-detect-bundle)
netbull/mobile-detect-bundle
now can be installed via composer on Symfony 5 project
@netbull Service "mobile_detect.mobile_detector" not found: even though it exists in the app's container....
it give me this error
and this is my code
symfony 5 and php 8
@lolop93 you will need to inject the MobileDetect just like you inject the repositories.
@lolop93 you will need to inject the MobileDetect just like you inject the repositories.
@netbull i dont know how....
this is i have
still dont work
and this neither dont work use SunCat\MobileDetectBundle\MobileDetectBundle;
i do the inyection but give me this error
@lolop93 FWIW, it is possible to gain the effects of the bundle using just the Twig Helper. No need to inject it. For example
{# base.html.twig #}
...
{% if is_mobile_view() %}
{% block nav_mobile %}
{% include 'Default/mobile_menu.html.twig' %}
{% include 'Default/top_menu.html.twig' %}
{% endblock nav_mobile %}
{% endif %}
@truckee @lolop93 FWIW, it is possible to gain the effects of the bundle using just the Twig Helper. No need to inject it. For example
{# base.html.twig #} ... {% if is_mobile_view() %} {% block nav_mobile %} {% include 'Default/mobile_menu.html.twig' %} {% include 'Default/top_menu.html.twig' %} {% endblock nav_mobile %} {% endif %}
yes i know but i prefer inject it on the controller for a better performance and readability
The twig helper works perfectly :)
First of all, thank you for the bundle! It's quite handy in many ways.
But as a cool project is quite unmaintained lately.. last PR merge is almost 2 years ago. The most vital PRs are for compatibility with Symfony 4.4 and 5 which is out now.