You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2022. It is now read-only.
I'm using the Cake4 branch to upload multiple images. I am using the afterPath event listener to customise the upload path so that my uploads are stored at:
articles\2020-07-04-104002\file_1.jpg
In order that the path does't include the folder "files" (my upload field as per the config) I had to do the following: - is this the best approach?
$path->setField(null);
Further, Is it possible to use the slug of the article in place of the data stamp, for example:
articles\my-article-title\file_1.jpg
I have looked into the createPath function of ProfferBehaviour but can't see how I can pass the parent entity (Articles) into the event where I'd need it to construct the path.
If this requires some custom development I would be happy to get involved and create a PR but I don't want to re-invent the wheel.
I'm using the Cake4 branch to upload multiple images. I am using the afterPath event listener to customise the upload path so that my uploads are stored at:
articles\2020-07-04-104002\file_1.jpg
In order that the path does't include the folder "files" (my upload field as per the config) I had to do the following: - is this the best approach?
$path->setField(null);Further, Is it possible to use the slug of the article in place of the data stamp, for example:
articles\my-article-title\file_1.jpg
I have looked into the createPath function of ProfferBehaviour but can't see how I can pass the parent entity (Articles) into the event where I'd need it to construct the path.
If this requires some custom development I would be happy to get involved and create a PR but I don't want to re-invent the wheel.
Thanks!