phpvms / phpvms_v2

Virtual Airline Management (not maintained)
http://www.phpvms.net
BSD 3-Clause "New" or "Revised" License
41 stars 46 forks source link

How are the modules/ redirects made in php? #135

Open apoorvpal01 opened 7 years ago

apoorvpal01 commented 7 years ago

Hello,

Not exactly an issue but any idea how one can set the navigational links to change the url to something/about or something/view without reloading and changing only one section of the page. I am familiar with php, js, css, html and jquery, jquery has an option to reload a div but that won't change the url of the browser just the div. Also I need the og:title, description and other meta tags to change based on what is loaded into the main body while the header and footer and navbar are static on the webpage.

Thanks!

nabeelio commented 7 years ago

You would need to use this: https://developer.mozilla.org/en-US/docs/Web/API/History_API

This is something that's handled by angular, react, or some type of front-end framework like that. You'd need to do quite a bit of rework on the templates and stuff, but reloading, etc is available through the action.php file.

apoorvpal01 commented 7 years ago

Thanks for your quick reply.

What I meant was suppose I have an about page, when I click on about in the navbar the URL will change to home/about and not .html or .php file and also only one div or one section changes to the content of the about page. If possible please inform me or share some relevant links. I am familiar with the languages mentioned above. If AngularJS is required for this, it would be great if you could send me a link to the documentation for this feature of AngularJS.

nabeelio commented 7 years ago

To get rid of the suffixes, you'll need to configure Apache or nginx for URL rewrites in whatever virtual host file there is. I sent you a link above to the history API, you can use that as a reference to Google up how Angular or whatever framework you want to use would handle that.