I have a visualforce page that I would like to inject custom components (header and footer) if they exist into the page.
According to the docs Creating and Displaying Dynamic Components I can instantiate a custom component like so
Component.c.MyCustomComponent myDy = new Component.c.MyCustomComponent();
but I don't know the name of MyCustomComponent ahead of time, and as mentioned it may not exist. Is there an equivalent of something like:
Component myDy = Type.forName('c:MyCustomComponent'); //does not compile ;)
I am not tied to dynamic visualforce, If anyone knows of an alternative solution I would be very interested.