Answer the question
In order to leave comments, you need to log in
How to combine the work of a php-router (from any framework) with vue-router?
The question is. For example, I want to write an online store platform with Vue and Zend Framework (Laminas). In this case, I use vue-router only in the directory. Here, let's say it's clear that I need to create two Vue objects, one for the directory, the other for the general one, however, there is a problem. Let's say there is a shopping cart in the header of the site. It turns out that it is served by a common Vue object, since the header and footer are all over the site. In such a case, how to pass data from the object for the directory to the shared object? Or are there any other recipes for using vue-router in certain places on the site, and the usual php routing in everything else?
It is very interesting to hear who has already encountered a similar development, what decisions they made.
Answer the question
In order to leave comments, you need to log in
There are no problems here, do the routing on vue as you like, and for individual routes that should be called directly from zend - just add the rules to your server config indicating that for these routes you should not use your js index file, but specify path to public index.php location for zend.
And yet it’s not entirely clear why specifically in your situation to share, I understand it makes sense when you need to catch callbacks from some kind of payment / apishka, but for a simple online store, only a vue router is enough.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question