If there is given an top. embedding $i:A \subset X$ and there exists a retraction $r: X\times I \to A\times I \cup X\times \{0\}$ I want to show that this induces the cofibration property of $i$, therefore HEP holds:
For given $g:X \to Y$ and homotopy $h:A \times I \to Y$ with $g \circ i = h(-,0)|_A$ and $h(-,0) = g$ there exist a homotopy $H: X \times I \to Y$ such that $H|_{i(A) \times I}=h$.
The crux of the matter is that I found already some proofs in Hatcher and TvDieck but I heard that there is an elegant way to prove using Yoneda lemma. Unfortunately I don't see how ...
$\require{AMScd}$There is indeed a formal proof of this result, but apart the fact that it is based on the universal property of pushouts it seems a bit of a stretch to claim that you're using Yoneda lemma.
in this diagram the universal property of $T = (A\times I) \cup_A X$ gives an arrow $T\to Y$; the existence of a retraction for the other canonical map $T \to X\times I$ amounts precisely to the request that $i$ has the HEP.
For the sake of completeness, I remember that the following conditions are equivalent (all come from Strom book):
Most (but not all) of these equivalences are proven invoking the universal property of $T$, as above.