This is just a use of serials class in Yii. I have added only additional user inputs to it to make it useable for generating serials based on user input data i.e. user_id,order_id etc
Yii all
Put in components folder.
$serial=new Serials(); $serial->generate();
$serial=new Serials(); $serial->inputs=array('user_id','user_name'); $serial->generate();
Total 6 comments
Thanks for the nice extension. However, you should consider extending intro text to actually write there, for what purpose your extension is. You put it only in extension description ("Generate Serial Numbers based on input or microtime"), a small text that is often missed, by many readers (like me!) :] It took me some time to find it and to answer myself, for what this extension actually is.
@garry
I still haven't used this but it looks like you put the script in components directory, so it should auto load here.
To use it either either use code in controller (recommended) or in a view. Likely you wouldn't use this in a model but I'm sure that you could if that made sense in your application.
Try first in a view to see what happens.
If this is bad advise, my apologies because I haven't used this extension, I just know that when you are stuck it's nice to have a quick response. So this is how I would approach this.
Good luck, doodle
Sorry, I am really newbie in here, can you explain where I put this script in model? or controller? if it not trouble to you, maybe you can give example script?
Thanks
Sorry,
I have updated documentation.
Thanks
$ serials: for the many $ serial: for the few.
It looks like in both code examples it should be $serials->generate(); and not $serial->generate();
Looks like it could be a useful extension but if this is an error (I didn't test this, I just read the description) it might stump some beginners.
doodle
Leave a comment
Please login to leave your comment.