在Symfony中,我在哪个目录中放置自定义类?

In my symfony application I would like to create custom php class. And access that class via back end and front end. Can someone show me which folder should I put that class and how to access it?

Thanks in advance!

You can put it in the /lib folder. There it'll be autoloaded by Symfony .

It's recommended to create subfolders in /lib to group classes/files by their function. (for example a directory /lib/routing for classes that concern the routing).