I really think that it would be beneficial to my workflow if I could just include a fully-functional component with a single php function call. Something like
ddl();
Which would produce an HTML drop down list, fully styled and functional. With external resources, I need to worry about including the JavaScript and CSS to get this working properly, but if I just included all of that within the ddl() function itself, it would make things much easier.
So something like:
<?php function ddl(){ <style> .ddl{ //style } </style> ?> <div class="ddl"> <!-- my drop down list --> </div> <script> //Do ddl functionality </script> <?php } What are the real drawbacks to doing things this way? Is it worse for performance?