jonseg / crud-admin-generator Goto Github PK
View Code? Open in Web Editor NEWAn open source tool to generate a complete backend from a MySql database.
Home Page: http://crud-admin-generator.com/
License: MIT License
An open source tool to generate a complete backend from a MySql database.
Home Page: http://crud-admin-generator.com/
License: MIT License
My link is like .../web/tablename but i wanna change it like .../tablename how can i do it I tried bunch of things but not even changing anythink thanks.
Surround
foreach ($table_columns as $col) {
if ($i == 0) {
$whereClause = " WHERE";
}
if ($i > 0) {
$whereClause = $whereClause . " OR";
}
$whereClause = $whereClause . " " . $col . " LIKE '%" . $searchValue . "%'";
$i = $i + 1;
}
with if ($searchValue)
Check the "date / datetime" type fields and tabs to create a form with this field type "date / datetime"
$initial_data = array(
'date_insert' => new \DateTime($row_sql['date_insert']),
);
$form = $form->add('date_insert', 'date', array('required' => false, 'input' => 'datetime', 'widget' => 'choice',));
Hi, I was wondering if there was a way to create a Master/Detail form using this. For example you could have a purchase Order and then you could add serveral products and get the order total.
Thank you!
First: THANK YOU VERY MUCH
All Textareas get an Richtext-Editor. How can i disable that?
After creating my first table "user" and running command "php console generate:admin" I get an error "Parse error: syntax error, unexpected '[' in C:\www\www\admingenerator\web\controllers\user\index.php on line 21" .
Using WAMP on windows and PHP ver 5.3.13.
Thx.
Hi,
what is the best way to have the generated pages by 'crud admin generator' answering to the following routes:
/myproj/adm/mytable1
/myproj/adm/mytable2
...
instead of:
/mytable1
/mytable2
...
I did that changing in the table controllers all the:
$app->match('/mytable1/list', function(
in:
$app->match('/myproj/adm/mytable1/list', function(
But it is a tedious task. What about to add a parameter in the generation of code?
Hi,
a customer needed a translated CRUD and an export so I customized your software a bit.
Do you have plans to built in translations and a CSV export?
If you like that features but have no time to develop them I would like to fork this project and send you 2 pull requests for each feature. Just tell me if you would accept them.
Thanks,
Ted
Hello! First of all I want to say thank you for such a great job.
The question is:
You have {{ table_column }} that returns the value to the table. Is there any parameter like this to return the Type of the field (for example varchar). It will allow easily to integrate checkboxes/date formats in the table...
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The phar extension is missing.
Install it or recompile php without --disable-phar
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
$recordsTotal = $app['db']->executeQuery("SELECT * FROM __TABLENAME__
" . $whereClause . $orderClause)->rowCount()
needs to change like this
$recordsTotal = $app['db']->executeQuery("SELECT count(*) as cn FROM __TABLENAME__
" . $whereClause . $orderClause)->fetch()['cn'];
If you have something like this :
CREATE TABLE IF NOT EXISTS `localiserservice` (
`service_id` int(10) unsigned NOT NULL,
`site_id` int(10) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `localiserservice` ADD PRIMARY KEY (`service_id`,`site_id`);
CREATE TABLE IF NOT EXISTS `service` (
`id_service` int(10) unsigned NOT NULL,
`srv_libelle` varchar(100) NOT NULL,
`srv_description` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `service` ADD PRIMARY KEY (`id_service`);
CREATE TABLE IF NOT EXISTS `site` (
`id_site` int(10) unsigned NOT NULL,
`sit_libelle` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `site` ADD PRIMARY KEY (`id_site`);
(sorry for the French)
console generate:admin
only generate 2 of the 3 tables, localiserservice
is missing... :-/
You can use the progresshelper component to show the real status of process
http://symfony.com/doc/current/components/console/helpers/progresshelper.html
e.g
Generating user module
1/1 [=================================] 100%
Generating food module
1/1 [=========================>-----------] 80%
All modules was generated successfully
We should change the way we add the relations because for each row we do a sql query.
for(col in columns)
{
if()
{
call to database
}
}
We should think in add them in the select clause (more difficult but more efficient)
See the comment in the commit:
7c46ba5#commitcomment-13988970
Hi
My custom version is coming along nicely but I have had to move over to my netbook (screen resolution 1024x600) due to persistent BSOD's on my main laptop. As a result of this I have found that the drop down menus in the left pane do not work correctly on Firefox v31.0 i.e. the menu option does not expand when clicked - It works correctly on both IE and Chrome. I have tried the latest version Admin LTE from GitHub which you say crud admin is based on and that works fine on all browsers. Any ideas what the problem may be.
Derek
Hello again, I would like to continue reporting some bugs or possible improvements.
After generating backend, panels does not load (js error) if database has any blob fields. If I edit controller and comment blob fields, the problem is solved.
Regards
Hi,
I have setup crud-admin-generator on a Ubuntu 14.04 with Apache2 and MySQL. Everything is working fine and i can see the tables in the dashboard. But when i expand a table (in this case named prd) and click List or Create i receive "The requested URL /prd was not found on this server"
What could be wrong ?
/Jimmy
And at the end of the error message, I have : ' See : http://datatables.net/tn/7
According the console in google chrome developper tool, I have :
'GET http://crudadmin.local/biens/list?draw=2&co ...(very long string) ... 414 (Request-URI Too Long)' .... jquery.min.js:6
So I reconfigure apache with a larger value for LimitRequestLine without success.
If I reduce the field number in the table, I have no error.
So How I can "increase" this field number in a table
Any help appreciated. Thanks
I have done a lot of test adding doctrine ORM inside this project but I don't know if in this case will be good or bad. In this case we will transform dinamically into statically or strong typed.
It would require:
1rst way:
Change the base controller adding queryBuilder (more typed) instead nomal queries (http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/query-builder.html)
We would need to create the query builder in console.php
2nd way:
Change the base controller adding DQL SELECT (http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html) (select via object/typed .More similar than normal queries) instead nomal queries
We could add via replaces in console.php or only changing the base.
3rd way:
Change doctrine/dbal for native-sql doctrine/orm only the bases (http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/native-sql.html). It will allow to add via 1rst way in custom methods/pages... It could be a good decision
What do you think @jonseg ?
running a server locally,
-download all references through composer - done
-running localhost at web dir - I got the dashboard
http://i.imgur.com/wBszCk6.png
....solved...
Relations are planned? Out of the box saw
Now we need table2_id to be more flexible it could be editable. For examIe in doctrine/orm exist a NamingProvider (group of functions) that it uses it when needs to obtain the name. Look at this:
Hi all,
I have set up crud admin for a database. It loads the home page fine, but as soon as i click on a database table and select either list or create, the server throws a 404 error saying that the directory /crud-admin-path/table-name was not found.
This is my config:
Alias /outdoorparadise /var/www/crud_admin/web
<VirtualHost *:80>
DocumentRoot /var/www/crud_admin/web
DirectoryIndex index.php
<Directory "/var/www/crud_admin/web">
Options Indexes MultiViews FollowSymLinks
Order Allow,Deny
Allow from all
AllowOverride all
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir none
</ifModule>
</Directory>
</VirtualHost>
It doesnt matter if I run it on localhost or on a real server as shown below:
i successfully installed it and can show Dashboard page with my db tables on the left panel.
but when i clicked one table it has no response. and there is no add/update/detlete etc menu showing.
Any help would be appreciated!
Hey, I just make admin panel via generator. Problem is
$form = $form->add('title', 'text', array('required' => true));
In page form element required="required", but when I deleted it with chrome and send empty field it accepts. Thank you
I'm getting "Parse error: syntax error, unexpected T_FUNCTION in "/example_path/to/../base.php on line 22" when try to access the installed directory. On my localhost the installation went ok...
Is this a php version issue?
I have problem getting list of from created table. In dev. tools I can see notice/error in web/controllers/table_name/index.php on line 87 "$queryData->draw = $draw;" - it says that "draw" is undefined variable. (after deleting this line, everything works)
Also on line 37 in the same file I fixed this (after getting notices):
$searchValue = $search[value];
to this:
$searchValue = $search['value'];
And on line 42 this:
$orderClause = " ORDER BY ". $columns[(int)$orderValue[column]][data] . " " . $orderValue[dir];
to this:
$orderClause = " ORDER BY ". $columns[(int)$orderValue['column']]['data'] . " " . $orderValue['dir'];
Hi there,
Moved to nginx recently. Using this config but still when moving to example.com/someTable
the 404 is thrown by nginx. Any ideas?
server {
listen 80;
listen [::]:80;
server_name example.com;
root /var/www/example.com/web;
index index.php;
allow all;
disable_symlinks off;
autoindex on;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_FLAG "engine=on";
fastcgi_param PHP_FLAG "safe_mode=off";
fastcgi_param PHP_VALUE "open_basedir=none";
include fastcgi_params;
}
}
Commented in the commit: 7c46ba5#commitcomment-13988970
As soon as I have a space in column name, for example "End of Life" I'm geting this error when entering the List page;
"DataTables warning: table id=inventory_list - Ajax error. For more information about this error, please see http://datatables.net/tn/7"
When I remove the space it works. It doesn't look too good having to use "End_of_Life" for list page to work. Is it possible to have the list page to resolve underscores as spaces?
Thanks
Edit: Actually the Create page resolves underscores to spaces. And my column ISV_Account_Name resolves to "I s v account name", little bit weird? :P
not creating admin menu and not writing to database
Your installation instructions say to clone the repo, but it appears I don't have permissions?
$ git clone [email protected]:jonseg/crud-admin-generator.git admingenerator
Cloning into 'admingenerator'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
How are we supposed to get a copy of this?
Edit: Nevermind. https://github.com/jonseg/crud-admin-generator
works. You might consider re-writing your installation instructions.
Hello, I'm facing some problems creating crud forms. I can navigate through views but if y edit or update any row, get lot of messages like these:
Deprecated: ValidatorInterface was deprecated in version 2.5 and will be removed in version 3.0. Please use Validator\ValidatorInterface instead. in C:\MYPATH\htdocs\admin-generator\vendor\symfony\validator\Symfony\Component\Validator\ValidatorInterface.php on line 14
Deprecated: The "Symfony\Component\Validator\MetadataFactoryInterface" interface is deprecated since version 2.5 and will be removed in Symfony 3.0. You should use the "Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface" interface instead. in C:\MYPATH\htdocs\admin-generator\vendor\symfony\validator\Symfony\Component\Validator\MetadataFactoryInterface.php on line 14
Deprecated: The "Symfony\Component\Validator\Mapping\ElementMetadata" class was deprecated in version 2.5 and will be removed in 3.0. Use "Symfony\Component\Validator\Mapping\GenericMetadata" instead. in C:\MYPATH\htdocs\admin-generator\vendor\symfony\validator\Symfony\Component\Validator\Mapping\ElementMetadata.php on line 14
Deprecated: Symfony\Component\Validator\MetadataInterface was deprecated in version 2.5 and will be removed in 3.0. Use Symfony\Component\Validator\Mapping\MetadataInterface instead. in C:\MYPATH\htdocs\admin-generator\vendor\symfony\validator\Symfony\Component\Validator\MetadataInterface.php on line 14
... ( and more ) ...
Hi, can you help me with the installation? I've cloned it on github, then i don't know the curl and installing vendor. Sorry i don't know much about it, is there a portable version that i just copy to my htdocs folder?
Thanks.
I have this errors:
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
my database options are:
'dbs.options' => array(
'db' => array(
'driver' => 'pdomysql',
'dbname' => 'backend',
'host' => 'localhost',
'user' => 'root',
'password' => 'root',
'charset' => 'utf8',
),
)
));
NotFoundHttpException in RouterListener.php line 144:
No route found for "GET /category/web/resources/css/bootstrap.min.css" (from "http://128.199.xxx.xxx/api/admin/web/category/edit/1")
but when i access http://128.199.xxx.xxx/api/admin/web/ its ok, all css loaded
i have setup resource path
$app['asset_path'] = '../web/resources';
Some question about AG strategy:
Hello thk for your generator.
how to use many to many relationships ?
Hello Team,
we have followed all the steps, when we run php console admin generator, web page shows all the tables of the DB, but console/panel doesnt generate.
Please help!
Best regards,
Vijay
Hi,
I've been trying to play with your app but I couldn't solve a problem I'm having to use it, I don't know if there's some misconfiguration or requirement I need to have but it's not in the guide? Like activate mod rewrite in apache2? I do it but it didn't solve my problem...
The app loads the main page ok, but when I try to play with de database shows me an error:
The requested URL /Invoices_client was not found on this server.
Any help? clue? solution?
ive been experiencing issues viewing the tables and their data. I referred to a now closed issue (#23) but applying those changes did not solve my issue.
When entering http://localhost/sat-join-us/crudAdmin/admingenerator/web//itinerary (this is the link that the >>list links to) into the url i get an object not found 404 error,
but when i enter http://localhost/sat-join-us/crudAdmin/admingenerator/web/index.php/itinerary the tables load.
Any idea where ive gone wrong?
http://silex-simpleuser-demo.grimesit.com
https://github.com/jasongrimes/silex-simpleuser-demo
http://www.jasongrimes.org/2014/09/simple-user-management-in-silex/
or
http://www.bubblecode.net/en/2012/08/28/mysql-authentication-in-silex-the-php-micro-framework/
or
http://librosweb.es/silex/apendice_a/securityserviceprovider.html
I'm following the installation instructions exactly, but at the point where I run
php console generate:admin
It will not generate the views for my database tables. The command does not output any error and the database connection is OK. The website is generated successfully (actually it is working before the generate command).
Am I missing something to do which is not in the installation instruction or is a php requirement missing ?
here my commands I'm excuting:
git clone https://github.com/jonseg/crud-admin-generator.git admingenerator
cd admingenerator
curl -sS https://getcomposer.org/installer | php
php composer.phar install
edit src/app.php and fill in db-data, leaving /resources as it is
create nginx virtualhost pointing root to admingenerator/web/ -> admin website is working at this point correctly
php console generate:admin -> nothing happens, not even with -vvv (verbose) any output -> still no views for my tables
Hello,
When I rerun the php console generate:admin command, I do not see the new tables for views and controllers I created. I have tried cloning the crud generator again but no help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.