X
X
XenK2015-10-24 07:58:48
JavaScript
XenK, 2015-10-24 07:58:48

Phalcon and AJAX loading?

There is a main page "/", it is divided into several .volt templates ( header, main, footer ). It is necessary that when switching to "/about", another template is loaded in main, respectively, you need to use AJAX. Also, if when going directly (site.ru/about), the entire site was loaded with "/about". But how to do it correctly, prepare the controller, what to use, etc.?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Pochepko, 2015-10-24
@DJZT

I don't know the falcon, but I think it should look like this. You should have 2 controllers. The first is responsible for loading the page at the specified address. It downloads the complete base template. There should be a load event in js, after which it ajaxes to the second controller, which is responsible for the main part. That is, upon request, you take the content rendered for a specific view. And paste it into the container on the page.

Y
Yuri Grinev, 2015-10-24
@linakun

I didn't understand a thing. Do you want the falcon to return only the about template when you switch to /about, and not the footer with a header?
If you want to disable layout, then I advise you to read this:
https://docs.phalconphp.com/ru/latest/api/Phalcon_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question