fabiopaiva / zfc-user-crud
Crud interface for ZfcUser with Doctrine ORM.
Installs: 1 303
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 4
Open Issues: 0
Requires
- php: >=5.3.3
- bjyoungblood/bjy-authorize: 1.4.*
- zf-commons/zfc-user-doctrine-orm: 1.0.*
This package is not auto-updated.
Last update: 2024-10-26 17:13:29 UTC
README
ZfcUserCrud provide a CRUD interface to manage Users and Rolers. Require ZfcUserDoctrineOrm.
Instalation
php composer.phar require fabiopaiva/zfc-user-crud:dev-master
Usage
In application.config.php enable this modules:
<?php //
return array(
'modules' => array(
'DoctrineModule',
'DoctrineORMModule',
'ZfcBase',
'ZfcUser',
'ZfcUserDoctrineORM',
'ZfcUserCrud',
// .. Another modules you use
'Application'
),
...
Don't forget to configure your Doctrine ORM eg: doctrine.local.php
<?php
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'dbUser',
'password' => 'dbPass',
'dbname' => 'dbName',
)))));
Create tables
./vendor/bin/doctrine-module orm:schema-tool:update --dump-sql
#if it's ok, execute
./vendor/bin/doctrine-module orm:schema-tool:update --force
In your view use this routes:
<?php echo $this->url('zfc-user-crud');?> For user interface
<?php echo $this->url('zfc-user-crud-role');?> For role interface
<?php echo $this->url('zfc-user-crud-password');?> For change user password
Override configuration if you wanna use your own entities
return array(
'zfcusercrud' => array(
'userEntity' => 'ZfcUserCrud\Entity\User',
'roleEntity' => 'ZfcUserCrud\Entity\Role'
)
#ZfcAdmin
To use with ZfcAdmin, just override the route like this:
<?php
return array(
'router' => array(
'routes' => array(
'zfcadmin' => array(
'child_routes' => array(
'zfc-user-crud' => array(
'type' => 'segment',
'options' => array(
'route' => '/users[/:action][/:id]',
'defaults' => array(
'controller' => 'ZfcUserCrud\Controller\Crud',
'action' => 'index',
),
),
),
),
),
'zfc-user-crud' => array(
'options' => array(
//if you change your ZfcAdmin url(admin), you must use your new url
'route' => '/admin/users[/:action][/:id]'
)
)
),
)
);