Last active
August 29, 2015 14:08
-
-
Save mockiemockiz/99e1c6faba6574e9d251 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// module/User/src/User/View/Helper/Hellohelper.php | |
/** | |
* Created by PhpStorm. | |
* User: mockie | |
* Date: 11/8/14 | |
* Time: 5:33 AM | |
*/ | |
namespace User\View\Helper; | |
use Zend\View\Helper\AbstractHelper; | |
class Hellohelper extends AbstractHelper | |
{ | |
public function __invoke($str) | |
{ | |
return $str.' okeee'; | |
} | |
} |
This file contains 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 echo $this->hello_helper($this->myvar); ?> |
This file contains 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
//yourModule/config/module.config.php | |
'view_helpers' => array( | |
'invokables'=> array( | |
'hello_helper' => 'User\View\Helper\Hellohelper' | |
) | |
), |
This file contains 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
public function testAction() | |
{ | |
$this->layout()->myvar = 'teeeeeeeeeeeeest'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment