View Rendering

I’d say technically it’s a valid approach but I’d be concerned about readability.

First, in standard templates the html code sequence is in most cases very similar to the final source sent to the browser - there is less fragmentation of code and fewer non-html (programmatic) chunks. In a view class like yours the overall code differs much more to what the browser will receive and will make it more difficult to spot common problems like unclosed tags, etc.

Second, keeping html in heredoc quotes usually means your IDE will not syntax-colour it nor provide closing tags correction or html auto-completion.

Third, such views can be hard to read and edit by non PHP programmers. While simple template commands are quite easy to learn by designers (even in pure PHP templates), the concept of classes, methods and other OOP stuff may be a bigger barrier.

What were you trying to achieve with this method? I think it might work in some very specific scenarios where html code needs a lot of complex presentation programming logic because programming is obviously more flexible in PHP than in template languages. But I wouldn’t recommend it as a general practice.