Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option random_cb for images in edit fields #930

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

niahoo
Copy link

@niahoo niahoo commented Oct 7, 2015

Hi,

this is a small addition to let the developer generate image names.

I wanted to add a function possible value to the naming option and add a naming_cb option, but this requires some refactoring to keep the code clean*.

So, this just adds the possibility to provide a callback, but it is of-course not mandatory for the callback to provide actual-random names. (md5 of the file content is what I personnally do !).

Also if you like this and would rather set the defaults-options/rules in the Field\File class, just tell me.

(* I wish that Multup does not generate names by itself, only using the callbacks it's given or a name (string) it's given.)

…to provide a callback to generate the random name.
@niahoo
Copy link
Author

niahoo commented Oct 27, 2015

Hi, could you tell me if you're interested or not ?

@davemathews
Copy link
Contributor

@niahoo I'm interested just trying to decide the full need v/s if this is the best way.

@niahoo
Copy link
Author

niahoo commented Oct 29, 2015

The full need is to be able to specify the file name with a function. The best thing to do imho is to allow a function as a value for the naming option.

I can code that if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants