代码之家  ›  专栏  ›  技术社区  ›  Aswathy S

如何在Contao模板中获取实际图像路径

  •  1
  • Aswathy S  · 技术社区  · 7 年前

    我的代码:

    $GLOBALS['TL_DCA']['tl_news']['fields']['image'] = array
    (
        'label'                   => &$GLOBALS['TL_LANG']['tl_news']['quoteperson_image'],
        'exclude'                 => true,
        'filter'                  => true,
        'inputType'               => 'fileTree',
        'eval'                    => array('tl_class'  => 'clr','files' => true,'fieldType' =>'checkbox',),
         'sql'                    => "blob NULL",
    );
    
    1 回复  |  直到 7 年前
        1
  •  4
  •   fritzmg    3 年前

    fileTree 小部件是一个二进制UUID。为了获得原始路径,您可以执行以下操作,例如:

    $objFile = \Contao\FilesModel::findByUuid($uuid);
    $strPath = $objFile->path;