+ Start a Discussion

What is the equivalent of {!$Resource.TestImage} in apex code?

I want to get the  image URL in a VF page from the controller class. The image is in the StaticResource.

What is the equivalent of {!$Resource.TestImage} in the apex class? 

Best Answer chosen by Admin (Salesforce Developers) 

Got it. It is just thisURL  '/resource/TestImage'