Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

[SOLVED] Can't get get_doctype() to return HTML5

If I set in my controller or view service setup

Phalcon\Tag::setDocType(Phalcon\Tag::HTML401_TRANSITIONAL);

I get the correct document type declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

If I put in

Phalcon\Tag::setDocType(Phalcon\Tag::HTML5);

I get no return from {{ get_doctype() }} at all.

I can kinda follow the C code, and it looks like HTML 5 declaration is the default if nothing has been declared, but it doesn't seem to be working that way. I have noticed that both of the demo apps forgo the use of get_doctype() and just have the declaration hardcoded. Anyone else seeing this issue? i don't see a bug report for this, but I might have to put one in I guess.



3.6k
Accepted
answer

Looks like the fix for this will be in 1.2.5 via issue/pull request #1667. Until then, I'll just hardcode it.