echo/return in the core
Posted: Fri Jul 05, 2013 2:21 pm
Because of the smartification, it turned out that a lot of functions in the core had to be catched with ob_start and then the buffer filled into smarty-variables to position the sections in the desired flow. So I already started to change some functions to use return instead of echo.
I realize that this might be problematic, because there was a pattern before: Functions called print_X echoed their content. Now that is mixed up.
I want to change that by letting all functions return their content, always. Only the very first level, index.php/genpage.inc.php and serendipity_admin.php, should echo stuff.
Does that plan has flaws? Or do all agree?
PS: I feel like I already wrote that in this forum, but I can't find it. Maybe I just wanted to do that.
I realize that this might be problematic, because there was a pattern before: Functions called print_X echoed their content. Now that is mixed up.
I want to change that by letting all functions return their content, always. Only the very first level, index.php/genpage.inc.php and serendipity_admin.php, should echo stuff.
Does that plan has flaws? Or do all agree?
PS: I feel like I already wrote that in this forum, but I can't find it. Maybe I just wanted to do that.