Here, I come with the quick and small tip which is useful to every developer.In this example, you will see how to use an alternate image if image not exists or image not found.
Well, To display placeholder image in corePHP, mostly we write lengthy code using jQuery, Javascript or something else which is quite complicated but I am going to show the easiest way to do it.
Let’s understand by example:
1 2 3 | <img src="<your_image>" onError="this.src='Images/<your_placeholder_image>'"> |
I hope this example will be useful to you because I really did run.Any doubt drops comment.
Thank you for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.
Comments (1)