Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dlnkrg's avatar

Js and PHP

Hey people!

I am currently thinking about fiddling with Laravel again.

But I have a hard time understanding the difference between PHP Frameworks and JS Frameworks.

If I build a PHP App, do I need a JS framework for Dropdown menus etc.?

0 likes
6 replies
Tray2's avatar
Tray2
Best Answer
Level 73

The simple answer is NO, you don't need it but you might benefit from it.

PHP is back end and generates html while Javascript lives in the browser, making it more interactive.

There is no need to use any frameworks but they greatly speed up the development, but sometimes they are overkill.

1 like
martinbean's avatar

@dlnkrg You don’t need it, but if you want any front-end interactivity then yes, that’s usually achieved with client-side JavaScript, no matter what technology is being used on the server. You’d use JavaScript with PHP, or C#, or Python, or Ruby…

1 like
Lumethys's avatar

Laravel is a backend framework, while something like React, Vue, Angular is a frontend framework

Frontend JS framework is used to build Single-page application (SPA), if you are new you could think of it like this:

When you decide to make SPA, you are making 2 app: the backend app which live in the server, the frontend app which live in the client's browser. This way SPA can do many advanced UI interaction that was not possible before? But what is "before"? Before JS framework was born, WebApp was handled solely by the "backend" framework alone. Well they are not called backend at the time because frontend did exist yet, but you get the idea.

Laravel is one such framework. It can handle every thing on its own, or serve as an UI-less backend for a frontend framework, depend on your choice

But if you are interested in Laravel, just go with the "fullstack" option

1 like
Sinnbeck's avatar

@Lumethys good explanation but a few things

  1. A frontend does not need to be an spa (they rarely are). Most sites just use a bit of Javascript on each page to make it dynamic
  2. Javascript has been around since 1995
2 likes
Lumethys's avatar

@Sinnbeck i agree, but nowadays, when we are talking about JS "framework". It usually mean SPA or SGG, isnt it

1 like
Sinnbeck's avatar

@Lumethys You could argue that yes, but based on the level of knowledge of the poster, I assumed they meant any javascript (or perhaps also libraries) :) React is used for SPA, but isnt a framework but a library for instance

2 likes

Please or to participate in this conversation.