A new AJAX CRUD generator for Yii framework.
check a demo here
you can download the extension here:Download
Requirements ¶
Bootstrap
Usage ¶
Note:integrate bootstrap before doing this.
step1:Download the zip file and put it in your extensions directory.
step2:
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123',
'generatorPaths' => array(
'ext.ajaxgii',
),
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
eg: i have a table test(id,name,age).I have generated a crud for this.You can find a demo below.
Resources ¶
GitHub ¶
- Find source code @GitHub:https://github.com/sirinibin/yiidemos
Credit goes to ¶
1.bootstrap
i have used bootstrap's gii crud generator to make my customized giiplus crud generator.
2.TCPDF
For PDF generation i have integrated an extension with this crud generator
Name: TCPDF
Version: 5.9.157
Release date: 2012-04-16
Author: Nicola Asun
URLs:
http: www.tcpdf.org
http: www.sourceforge.net/projects/tcpdf
so im giving all the credits to Nicola Asun for this Pdf generation feature.
Regards,
Sirin K
nice one
Nice one man, expecting more of this type from you..
thanks
thanks
Yiibooster support?
This looks great! Do you recon it will works with Yiibooster?
seems like it will work.
Hi
i havn't tried with Yiibooster but seems like it will work with yii booster too,ie you can use this "ajaxgii" folder instead of that gii dir inside Yiibooster also i have used most of the Yii-bootstrap widgets inside this code generator.so i dont see any issue on it.
-Sirin
@Mikey
Now im thinking about some awseome widgets in Yiibooster in my crud generator.i will posting its next version asap.thanks alot man.
-Sirin
input validation
it seem very nice but there is a validation of input data? i have put a string on "age" field but no error message is visualized ;)
Update bootstrapgenerator.php
FYI
Alias "application.extensions.giiplus.bootstrap.BootstrapCode" is invalid. Make sure it points to an existing PHP file and the file is readable.
need to change the line in bootstapgenterator.php
to use this ext. name
public $codeModel = 'application.extensions.ajaxgii.bootstrap.BootstrapCode';
What bootstrap is this intended for?
I was just wondering which bootstrap this is intended to be used with?
I use this boostsrap. So you must register it in the top of all your view files or it wont work because it isn't preloaded so your page load times are faster but it has less extensions.
i.e.
<?php Yii::app()->bootstrap->register(); ?>
@skworden
@skworden:thanks for the report i have made this change in download file and git repo. too.
and you can use bootstrap like you do usually no change in that but make sure that you are using the latest prefix "Tb" for bootstrap widegts.
'preload'=>array('log','bootstrap'), 'components'=>array( 'bootstrap'=>array( 'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions 'coreCss'=>true, // whether to register the Bootstrap core CSS (bootstrap.min.css), defaults to true 'responsiveCss'=>false, // whether to register the Bootstrap responsive CSS (bootstrap-responsive.min.css), default to false 'plugins'=>array( // Optionally you can configure the "global" plugins (button, popover, tooltip and transition) // To prevent a plugin from being loaded set it to false as demonstrated below 'transition'=>false, // disable CSS transitions 'tooltip'=>array( 'selector'=>'a.tooltip', // bind the plugin tooltip to anchor tags with the 'tooltip' class 'options'=>array( 'placement'=>'bottom', // place the tooltips below instead ), ), ), ),
thanks
@salsero:Input validation
@salsero:Input validation is working fine when both creating and updating records but whats the thing is when you try to update a record it is not showing you the validated errors.but if you are creating a new record it will show you the validated errors.
i did spend so many times to fix this issue,but was not able to figure out why this validated errors are not showing on the form when record updation.Please let me know if any of you guys are able to fix this issue.thanks
-Sirin
looks nice... but
Looking at the generated demo code in github.
While this looks nice visually, I do not like how it looks in code.
You have presentation logic in controllers that should be in views.
Views may need some love from DRY principle as at the moment it seems ajax and non-ajax versions are completely standalone (i may be wrong here)
Session for pdf/excel generation saves every time even tho users rarely generate pdf/excel. I do not understand why you are doing the lenghty Criteria setup (which is vulnerable to SQL injection btw) and Ajaxtest::model()->findAll($criteria); when you could do just $model->findAll();
Im sorry if i seem too negative, that is not my intention. Take it as friendly and free code review. Keep going on what you are doing.
Demo Link
Hello,
Thanks for this nice extension.
The demo link seems to be dead.. May you please re-create it?
Minor Fix
Hello,
I noticed that you have used "href='javascript:return;'" for the action links, which throws a js error. (although functionality is not affected)
I recommend using "href='javascript:void(0);'" instead, as it is cleaner.
Thanks
First of all, thanks for the good work. It was very usefull.
Your Test table attributes are still in template, so they are causing an exception in View action.
I suggest you to use attribute labels instead column names in export templates. I've done it with
CActiveRecord::model($this->model)->getAttributeLabel($column->name);
Not sure if it is good practice, but it worked :)
Another suggestion is to consider using Eexcelview to export Excell.
And the last problem is with access rules. If guest tries to access action which requires login, the whole login page is rendered below index.I solved it by using this article loginRequiredAjaxResponse.
Some minor bugs are fixed
Some minor bugs are fixed.thanks for the support.
@sirin
Nice one :-)
Please write a wiki with step by step setup including bootstrap setup etc with links.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.