Symfony, services,

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gintare
    New Member
    • Mar 2007
    • 103

    Symfony, services,

    I follow online course about Symfony.
    https://www.udemy.com/introduction-to-web-development-with-symfony2/#/lecture/934594

    In lecture 79 they create service for Author:

    myproject\src\B log\CoreBundle\ Controller\Auth orController.ph p

    Code:
    class AuthorController extends Controller
    {
        public function showAction($slug)
        {
            $author = $this->getAuthorManager()->findBySlug($slug);
            $posts = $this->getAuthorManager()->findPosts($author);
            
            return array(
                'author'=>$author, 
                'posts'=>$posts
            );    
           
        }
    
        private function getAuthorManager()
        {
            return $this->get('authorManager');
        }
    }
    I do not understand from where they call methods:
    ->findBySlug($sl ug) and ->findPosts($aut hor).

    How to find this place in code?
  • gintare
    New Member
    • Mar 2007
    • 103

    #2
    They are defined in file
    myproject\src\B log\CoreBundle\ Services\Author Manager.php

    Comment

    Working...