Yii 1.1: serial-generator

Generate Serial Numbers based on input or microtime
6 followers

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();

Total 7 comments

#15317 report it
PeRoChAk at 2013/10/28 09:16am
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

#12791 report it
Trejder at 2013/04/12 04:22am
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.

#11207 report it
got 2 doodle at 2012/12/27 04:39pm
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

#11203 report it
garry at 2012/12/27 04:36am
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

#7780 report it
PeRoChAk at 2012/04/18 01:13am
Serials to serial

Sorry,

I have updated documentation.

Thanks

#7756 report it
Lê Văn Chiến at 2012/04/15 08:08pm
Incorrect syntax

$ serials: for the many $ serial: for the few.

#6901 report it
got 2 doodle at 2012/02/11 03:30pm
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

Leave a comment

Please to leave your comment.

Create extension
Downloads