I am working on a project in which I define ID inside of a <body> tag. For different pages I define different IDs, & I always follow this structure for my all projects. But in our new project which is in CakePHP, my developer said to me that I should never use ID inside the body tag for a CakePHP project.
When I asked him why, he said because we can generate ID through CakePHP.
I don’t know so much about CakePHP, but I think we can define ID inside the body tag for CakePHP & other languages also.
Please provide some links or articles & your suggestions about it.
Thanks in advance 🙂
You can define id’s in your HTML mark-up that’s not a problem. But from your question it looks like you are defining id’s as an attribute to body tag?
Well you can define id’s in body tag. but the problem is in cakePHP you have layouts which usually contain the wrapping HTML of your views, like header, footer etc. So you can not manually define static id’s inside body tag for different pages, well you can but then you won’t be using layouts.
What your developer telling you I guess is the use of (uuid) unique id’s a feature provided by cakePHP to generate unique id’s for DOM elements.
you can generate id’s via
uuid(string $object, mixed $url)function in your views.To learn more visit : http://book.cakephp.org/view/1091/uuid