This question is a bit hard to explain, but I'll try my best.
Say, I am creating an job add aggregator site. For this, I have 10 job sites I will crawl through, parse the HTML and get all the juices.
Now, since each sites template, url and the amount of information they contain is unique, something tells me the crawling part should be organized separately.
Normally, I could put it all together in
class CrawlerController extends Controller {
public function fooDotComAction(){
}
public function barDotNetAction(){
}
}
You can see the above is still better than dumping all my crawler logic inside the DefaultController, but even my example doesn't seem efficient, or modular.
It seems like a bad practice, I am wandering if there is some sort of feature in Symfony that provides an implementation or guide for such problems.
Your question is too broad but you have find the design pattern who will fit your needs then implement it. You will need to create php class and to declare them as services.
Symfony promotes the ideas of service-oriented architecture and has powerful solution for separation of concerns: The Dependency Injection Component. In short, this component provides implementation of the Service Container: a tool for configuration, binding and creation of the separate service objects.
Your business code will be contain in domain services and your controller will just organize the input and output and call the domain services
check out https://codereviewvideos.com/blog/symfony-compiler-pass-tutorial/
and the 2 linked videos and explanations. (1, 2)
it will show you how you can, in a clean way, seperate each 'crawler', using tagged services and a compiler pass, which i think would be a clean way of doing this .