Generate a complete backend from a MySql database. In seconds.

The backend is generated in seconds without configuration files, you have total control over the code.
Other tools use configuration files where there is a lot of "magic" and is very difficult to adapt to your needs.
Clone GitHub repository:

  1. git clone https://github.com/jonseg/crud-admin-generator.git admingenerator
  2.  
  3. cd admingenerator

Download composer:

  1. curl -sS https://getcomposer.org/installer | php

Install vendors:

  1. php composer.phar install

You need point the document root of your virtual host to /path_to/admingenerator/web

This is an example of VirtualHost:

  1. <VirtualHost *:80>
  2. DocumentRoot /path_to/admingenerator/web
  3. DirectoryIndex index.php
  4. <Directory "/path_to/admingenerator/web">
  5. Options Indexes FollowSymLinks
  6. Order Allow,Deny
  7. Allow from all
  8. AllowOverride all
  9. <IfModule mod_php5.c>
  10. php_admin_flag engine on
  11. php_admin_flag safe_mode off
  12. php_admin_value open_basedir none
  13. </ifModule>
  14. </Directory>
  15. </VirtualHost>

Edit the file /path_to/admingenerator/src/app.php and set your database conection data:

  1. $app->register(new Silex\Provider\DoctrineServiceProvider(), array(
  2. 'dbs.options' => array(
  3. 'db' => array(
  4. 'driver' => 'pdo_mysql',
  5. 'dbname' => 'DATABASE_NAME',
  6. 'host' => 'localhost',
  7. 'user' => 'DATABASE_USER',
  8. 'password' => 'DATABASE_PASS',
  9. 'charset' => 'utf8',
  10. ),
  11. )
  12. ));

You need to set the url of the resources folder.
Change this line:

  1. $app['asset_path'] = '/resources';

For the url of your proyect, for example:

  1. $app['asset_path'] = 'http://domain.com/crudadmin/resources';

Now, execute the command that will generate the CRUD backend:

  1. php console generate:admin

This is it! Now access with your favorite web browser.
The command generates one menu section for each database table. Now will be much easier to list, create, edit and delete rows!



Article Information
Article ID Categories Tags Levels Status
#20
Free
Open