Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7729041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:52:09+00:00 2026-06-01T05:52:09+00:00

I have a PHP application that is built around the MVC architecture without any

  • 0

I have a PHP application that is built around the MVC architecture without any frameworks that currently generates full pages.

For example: Visiting (http://site.com/xyz) would generate the full page and deliver it to the browser.

I now want to add AJAX into the mix, so that only part of the page is returned via an AJAX response. For the above example, it is quite easy to implement.

However, the application is hierachical in the sense that there can be many sub pages and pages within subpages.

In my case, let’s take this page for example: http://site.com/system/backups/databases

The the above case, the following should occur:

  • If the user is on site.com, the application should generate system/backups/databases and return it in the AJAX response.

  • If the user is on site.com/system, the application should generate backups/databases and return it.

  • … and so on.

I am using YUI3 as my javascript framework and would like to minimize any code duplication. How should I deal with the client side?

  • Should I have a central AJAX component that does ALL the ajax for loading, displaying and unloading pages?

  • Or should I have a main AJAX component that only deals with loading one level (in this case /system/) and let the page loaded by /system/ handle the loading of its subpages? This approach seems like it will result in a fair bit of code duplication, but I could be wrong.

  • On the server side, how should this be handled? How should the server decide whether to render system/backups/databases or just backups/databases or databases?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:52:11+00:00Added an answer on June 1, 2026 at 5:52 am

    The solution I came up with was to just send all the HTML over to the client. I have made sure that my HTML is structured properly with IDs and classes to indicate a “sub page”.

    With this information, the client then knows what is already displayed on the page and what has been received. It then simply removes the parts that are different to the ones receieved and inserts the new parts.

    Obviously, this is somewhat inefficient, as we are sending the full response (instead of just the required response) over the wire, but this reduces a lot of logic to sync the client views with that is generated on the server side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP web application built with CodeIgniter MVC framework. I wish to
I have a web application that needs to be built using PHP/MySQL. The application
We have a web application that has been built using MySQL / PHP /
We have an a PHP application that we are converting to MVC. The goal
I have a PHP application that displays a list of options to a user.
I have a PHP application that will on occasion have to handle URLs where
I have a PHP application that makes extensive use of Javascript on the client
I have a php application that is installed on several servers and all of
I have a PHP application that sends email using the pear Mail function. Unfortunately
I have a php web application that uses big cookies to store a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.