PMA\libraries\Theme::getImgPath PHP Method

getImgPath() public method

If filename is given, it possibly fallbacks to fallback theme for it if image does not exist.
public getImgPath ( string $file = null ) : string
$file string file name for image
return string image path for this theme
    public function getImgPath($file = null)
    {
        if (is_null($file)) {
            return $this->img_path;
        }
        if (is_readable($this->img_path . $file)) {
            return $this->img_path . $file;
        }
        return './themes/' . ThemeManager::FALLBACK_THEME . '/img/' . $file;
    }

Usage Example

Example #1
0
 /**
  * Test for getImgPath
  *
  * @param string $file   file name for image
  * @param string $output expected output
  *
  * @return void
  *
  * @dataProvider providerForGetImgPath
  */
 public function testGetImgPath($file, $output)
 {
     $this->assertEquals($this->object->getImgPath($file), $output);
 }