PHP code example of wernerkrauss / folderperpage
1. Go to this page and download the library: Download wernerkrauss/folderperpage library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wernerkrauss / folderperpage example snippets
function getCMSFields() {
/*...*/
$pic = UploadField::create('Avatar', 'Your Avatar');
$fields->addFieldToTab('Root.Main', $pic);
$pic->setFolderName($this->getRootFolderName());
/*...*/
}
yml
NetWerkstatt\FolderPerPage\Extensions\RootFolder:
ignored_classes:
- SilverStripe\CMS\Model\VirtualPage
- SilverStripe\ErrorPage\ErrorPage
create_folder_for_translations: false
folder_root: 'Articles'
$this->getRootFoldername()