PHP code example of wakers / cms-base-module

1. Go to this page and download the library: Download wakers/cms-base-module 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/ */

    

wakers / cms-base-module example snippets


$protectedFile = new ProtectedFile('my-super/sub-folder/', NULL);
$tmsName = $protectedFile->move($fileUpload); // vrací unikátní název

// ... Název někam uložíme - třeba do DB

$name = 'nahled.jpg' // Načteno např. z DB
$protectedFile = new ProtectedFile('my-super/sub-folder/', $name);
$protectedFile->remove();

$name = 'nahled.jpg'; // Načteno např. z DB
$title = 'Titulek obrázku'; // Načteno např. z DB

$protectedFile = new ProtectedFile('my-super/sub-folder/', $name);
$protectedFile->setAttr('title', $title);