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
Requirements ¶
Yii all
Usage ¶
Put in components folder.
$serial=new Serials();
$serial->generate();
$serial=new Serials();
$serial->inputs=array('user_id','user_name');
$serial->generate();
Possible typo in description?
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
Incorrect syntax
$ serials: for the many
$ serial: for the few.
Serials to serial
Sorry,
I have updated documentation.
Thanks
how to use
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
Where to put this
@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.
$serial=new Serials(); $serial->generate();
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
Extend description
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.
thanks
@Trejder
Thanks for your replay. The purpose of the extension was that it enables you to generate Security String by using user inputs.
@ garry
Sorry for being late in reply.
This is a component and can should be placed in component directory and can be called as described in the example above.
Thanks
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.