Created
March 21, 2014 13:16
-
-
Save renepardon/9685963 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class SampleController | |
* | |
* ZF2 Controller Action after dispatch overwrite. | |
*/ | |
class SampleController | |
{ | |
/** | |
* This is our sample action. | |
* | |
* A route for this may look like this: | |
* /sample/:id[/:somethingDifferent] | |
* | |
* @example /sample/12/test | |
* | |
* @param int $id | |
* @param string $somethingDifferent | |
* | |
* @return array|ViewModel | |
*/ | |
public function myPerfectAction($id, $somethingDifferent = 'different thing') | |
{ | |
// Returns an array with 12 as $id and "test" as $somethingDifferent. | |
return [$id, $somethingDifferent]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment