Re: function -> action

From: Date: Fri, 03 Aug 2007 14:09:03 +0000
Subject: Re: function -> action
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-260139@lists.php.net to get a copy of this message
Ralph Kutschera escreveu:
Hallo! I'm working on a project, where we distinguish between "functions" and "actions" in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word "action" as "function"? E.g.: public function doSomething() { .... } public action doSomethingElse() { ... } ... is actually the same but would help to see the design also in the code. TIA, Ralph
That's not implemented in PHP language. What you should do is use adequate naming conventions, use verbs and as far as possible, describe what the function does: public function execute_someaction() {} public function sanitize_somedata() {} public function is_validwhatever() {} Can you understand what each function does by their names? What should they return? How about in your application(s)... ~ DM

« previous php.general (#260139) next »