Javascript Library

I am working on an open-source app using Slim 4 and other Symphony components.

I would like to know few opinions on the Javascript library to be used.

I am planning to use TailwindCSS for the theming features.

I could go ahead with Jquery for all JS related stuffs. But since I am new to Slim and PHP development, would be helpful to know other options to use in projects.

imo jquery is good enough for most websites :smiling_imp:

unless you want to learn a frontend framework
or if you already know a frontend framework…
because it will eat a lot of time to learn these

Thanks for your response.

I am unable to visualize how framework like Slim integrates with JS framework like React. Most projects that I came across in PHP world are based on some templating engine. Any link for sample project would be helpful to understand how a JS framework can be integrated with Slim and Twig templating engine.

FYI - I am a professional React developer with Java as backend.

Yeah, I do agree on JS framework. But I am trying to learn how a bridge can be created with Slim and a JS framework like React.

With Slim you build the backend API. The frontend framework interacts with the API. The frontend framework interacts with the API through requests and responses. So, use javascript fetch() in your js framework to make a GET call to your-api.com/all-posts and then the api returns json with all the posts.

These repos that make use of Slim Framework helped me gain some insights into building with Slim:

1 Like