Created
June 15, 2012 19:55
-
-
Save shama/2938426 to your computer and use it in GitHub Desktop.
load helper in a controller... dont do this!
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 | |
/** | |
* DONT DO THIS | |
* Just to show it is possible but if you are calling | |
* a helper from a controller then your code should likely | |
* be in a Model or Lib instead. | |
*/ | |
class ExamplesController extends AppController { | |
public function index() { | |
App::uses('FormHelper', 'View/Helper'); | |
$Controller = new Controller(); | |
$View = new View($Controller); | |
$Form = new FormHelper($View); | |
$input = $Form->input('test'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment