1

In my plugin, I would like to search a folder. However, I cannot find any information about the criteria for folders. Are there any documentation or something?

$n = Craft::$app->assets->findFolder(array(
    'name' => $folder,
    'parent' => $p_folder
));

My code is like this. Folder name is not unique, so I have to also use its parent. However, I do not know how to include parent folder in the criteria. "Parent" is not correct.

1 Answer 1

1

Check /vendor/craftcms/cms/src/models/FolderCriteria.php Class for reference. I guess most of craft's documentation lies in code.

Or you can visit https://docs.craftcms.com/api/v3/craft-models-foldercriteria.html which is the same thing.

check table "yourprefix_volumefolders" for data type of FolderCriteria.

1
  • Thank you very much, this document is I have been looking for.
    – Kota.M
    Commented Jul 18, 2019 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.