This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| echo "in"; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace app\controllers; | |
| use \app\models\Post; | |
| use \lithium\util\Inflector; | |
| Post::applyFilter('save', function($self, $params, $chain) { | |
| // Custom pre-dispatch logic goes here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace app\controllers; | |
| use \app\models\Post; | |
| use \lithium\util\Inflector; | |
| Post::applyFilter('save', function($self, $params, $chain) { | |
| // Custom pre-dispatch logic goes here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace app\models; | |
| use lithium\util\collection\Filters; | |
| use \lithium\util\Inflector; | |
| Filters::apply('app\models\Post', 'save', function($self, $params, $chain) { | |
| // Custom pre-dispatch logic goes here | |
| //create a slug for new posts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $container->loadFromExtension('security', 'config', array( | |
| 'provider' => array( | |
| 'main' => array( | |
| 'password_encoder' => 'sha1', | |
| 'document' => array( | |
| 'class' => 'Application/BlogBundle/Document/User', | |
| 'property' => 'username' | |
| ) | |
| )), | |
| 'firewalls' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Security Routes | |
| $collection->add('_security_login', new Route('/login', array( | |
| '_controller' => 'DoctrineUserBundle:Security:login', | |
| ))); | |
| $collection->add('_security_check', new Route('/login_check', array( | |
| '_controller' => 'DoctrineUserBundle:Security:login', | |
| ))); | |
| $collection->add('_security_logout', new Route('/logout', array( | |
| '_controller' => 'DoctrineUserBundle:Security:logout', | |
| ))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd src/ | |
| mkdir Bundle | |
| git clone https://github.com/knplabs/DoctrineUserBundle.git -b symfony2Security |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Symfony\Bundle\DoctrineMongoDBBundle\DoctrineMongoDBBundle(), | |
| new Bundle\DoctrineUserBundle\DoctrineUserBundle(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $container->loadFromExtension('doctrine_user', 'config', array( | |
| 'db_driver' => 'odm', | |
| 'password_encoder' => 'sha1', | |
| 'class' => array('model' => array( | |
| 'user' => 'Application\MyBundle\Document\User', | |
| 'property' => 'username', | |
| )), | |
| )); | |
| $container->loadFromExtension('security', 'config', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //MyRoutes | |
| $collection->add('admin', new Route('/admin', array( | |
| '_controller' => 'MyBundle:Admin:index', | |
| ))); | |
| //Security Routes | |
| $collection->add('_security_login', new Route('/login', array( | |
| '_controller' => 'DoctrineUserBundle:Security:login', | |
| ))); | |
| $collection->add('_security_check', new Route('login_check', array( |
OlderNewer