dinosoup Posted April 3, 2008 Share Posted April 3, 2008 Hi all. I was just starting to get into Drupal and trying to understand the code. I see code like the following: function drupal_maintenance_theme() { require_once './includes/theme.maintenance.inc'; _drupal_maintenance_theme(); } The function calls a function with the same name except with a "_" in front and that function is in the required file. Does the "_" in front have any special meaning in PHP? Or is it just a function naming convention? Thanks. Link to comment https://forums.phpfreaks.com/topic/99327-solved-function-naming-convention/ Share on other sites More sharing options...
devstudio Posted April 3, 2008 Share Posted April 3, 2008 Naming Convention (because of php4) Functions and Methods Functions and methods should be named using lowercase and words should be separated with an underscore. Functions should in addition have the grouping/module name as a prefix, to avoid name collisions between modules. Private class members (meaning class members that are intended to be used only from within the same class in which they are declared; PHP 4 does not support truly-enforceable private namespaces) are preceded by a single underscore. http://drupal.org/coding-standards Best, Nathan Link to comment https://forums.phpfreaks.com/topic/99327-solved-function-naming-convention/#findComment-508203 Share on other sites More sharing options...
Bigdogcms Posted April 3, 2008 Share Posted April 3, 2008 yup naming convention Link to comment https://forums.phpfreaks.com/topic/99327-solved-function-naming-convention/#findComment-508204 Share on other sites More sharing options...
dinosoup Posted April 3, 2008 Author Share Posted April 3, 2008 Oh I see. Thank you the quick response guys. Link to comment https://forums.phpfreaks.com/topic/99327-solved-function-naming-convention/#findComment-508208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.