2017 © Pedro PelĂĄez
 

library zfc-user-crud

Crud interface for ZfcUser with Doctrine ORM.

image

fabiopaiva/zfc-user-crud

Crud interface for ZfcUser with Doctrine ORM.

  • Tuesday, September 1, 2015
  • by fabiopaiva
  • Repository
  • 4 Watchers
  • 8 Stars
  • 1,143 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 16 % Grown

The README.md

ZfcUserCrud

ZfcUserCrud provide a CRUD interface to manage Users and Rolers. Require ZfcUserDoctrineOrm., (*1)

Instalation

php composer.phar require fabiopaiva/zfc-user-crud:dev-master

Usage

In application.config.php enable this modules:, (*2)

<?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, (*3)

<?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:, (*4)

<?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, (*5)

return array(
    'zfcusercrud' => array(
        'userEntity' => 'ZfcUserCrud\Entity\User',
        'roleEntity' => 'ZfcUserCrud\Entity\Role'
    )

ZfcAdmin

To use with ZfcAdmin, just override the route like this:, (*6)

<?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]'
                )
            )
        ),
    )
);

The Versions

01/09 2015

dev-master

9999999-dev https://github.com/fabiopaiva/ZfcUserCrud

Crud interface for ZfcUser with Doctrine ORM.

  Sources   Download

MIT

The Requires

 

zf2

01/09 2015

1.0

1.0.0.0 https://github.com/fabiopaiva/ZfcUserCrud

Crud interface for ZfcUser with Doctrine ORM.

  Sources   Download

MIT

The Requires

 

zf2