Skip to content

Instantly share code, notes, and snippets.

@shama
Created June 15, 2012 19:55
Show Gist options
  • Save shama/2938426 to your computer and use it in GitHub Desktop.
Save shama/2938426 to your computer and use it in GitHub Desktop.
load helper in a controller... dont do this!
<?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