This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dleee59417
dleee59417

Hello! I use the Media finder, when saving to the Database, the value looks like "/test.png", how can I bring the value to this form "test"?

test_logo:
    label: 'Media finder'
    mode: image
    imageWidth: '300'
    imageHeight: '300'
    span: auto
    type: mediafinder
daftspunky
daftspunky

Hey dleee,

The value test is not a valid file path and would break the media finder when viewing the image. You could manipulate the string using the pathinfo PHP function, like so

pathinfo('/test.png')['filename']; // Output: test

I hope this helps.

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.