PHP code example of dbstudios / doze-bundle

1. Go to this page and download the library: Download dbstudios/doze-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dbstudios / doze-bundle example snippets



    // app/AppKernel.php
    
    // ...
    class AppKernel extends Kernel {
        public function registerBundles() {
            // ...
            
            $bundles = [
            	// ...
            	new DaybreakStudios\DozeBundle\DaybreakStudiosDozeBundle(),
            ];
            
            // ...
    
            return $bundles;
        }
    
        // ...
    }


    use Symfony\Bundle\FrameworkBundle\Controller\Controller;
    use DaybreakStudios\DozeBundle\ResponderService;

    class MyController extends Controller {
        public function indexAction(ResponderService $responder, $id) {
            $entity = $this->getDoctrine()->getRepository('AppBundle:MyEntity')->find($id);

            if ($entity === null)
                return $responder->createNotFoundResponse();

            return $responder->createResponse($entity);
        }
    }