Function: is_component() and return_component(). - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Scripts & Components (http://get-simple.info/forums/forumdisplay.php?fid=11) +--- Thread: Function: is_component() and return_component(). (/showthread.php?tid=908) |
Function: is_component() and return_component(). - Zegnåt - 2010-08-04 For those times you need to test the existence of a component or run some extra code on it before executing. is_component() Pass the id of the component to this function. It will return either true or false, depending on whether the component exists. Code: function is_component($id) { return_component() Pass the id of the component to this function. It will return either the contents of the component in the form of a string or false, depending on whether the component exists. Code: function return_component($id) { Can I use it with the per page components function? I do not think this is compatible with my per page components function, but I didn’t test it. I will not work on making it compatible if it isn’t because these two functions should be seen as extensions to the core functions and not as extensions to another extension. |