Closed possible-is closed 2 years ago
Hello, the ->toEmbed()
method acts like ->isNotEmpty()
for this field, if the field is either empty or invalid it returns a falsy (null) value.
Like:
if($embed = $page->myfield()->toEmbed()) {
echo $embed->code()
}
Thanks a lot!
Hello Sylvain, i am not sure if this is really a classic issue, but i didn't know how else i could get in touch. When i enter an url in an embed field and save it, and then delete the url again, the field is not completely empty. There remains an emtpy input and media info. With this, i cannot check if the field is "->isNotEmpty()", because for kirby there is always a value in there. Is there a way around this? Greetings and thanks for the wonderful plugin, Matthias