Contao\FeedItem::addEnclosure PHP Метод

addEnclosure() публичный Метод

Add an enclosure
public addEnclosure ( string $strFile, string $strUrl = null )
$strFile string The file path
$strUrl string The base URL
    public function addEnclosure($strFile, $strUrl = null)
    {
        if ($strFile == '' || !file_exists(TL_ROOT . '/' . $strFile)) {
            return;
        }
        if ($strUrl === null) {
            $strUrl = \Environment::get('base');
        }
        $objFile = new \File($strFile);
        $this->arrData['enclosure'][] = array('url' => $strUrl . \System::urlEncode($strFile), 'length' => $objFile->size, 'type' => $objFile->mime);
    }