Like deceze already said, you shouldn't use a helper in your controller . But if you really want to, see this questions answer on how to do it with App::import: How can we call a helper function from a cakephp component - Pit Jun 23 '11 at 7:30
How to load helpers and use those helpers , and outline the simple steps for creating your own custom helpers . CakePHP includes a number of helpers that aid in view creation. They assist in creating well-formed markup (including forms), aid in formatting text, times and numbers, and can even speed up AJAX functionality.
CakePHP includes a number of helpers that help in view creation. They can support in creating well-formed markup language (including forms), formatting text, times and numbers, and can even speed up AJAX functionality. There are Few more helpers included in CakePHP .
Using a cakephp helper in the controller isnt permitted in the controller and model and rightly so. As you said helpers are associated with views and thats where it should be used. On Sep 7, 3:14 pm, cogitovn <[hidden email]> wrote: > Hi all, > I'm a newbie in cakePHP . > As I know, helper is a part of View.
action The controller action the form submits to, (optional). Use this option if you don't need to change the controller from the current request's controller . Deprecated since 3.2, use url. url The URL the form submits to. Can be a string or a URL array. If you use 'url' you should leave 'action' undefined.
Aliasing a helper replaces that instance anywhere that helper is used, including inside other Helpers . Using helper settings allows you to declaratively configure your helpers and keep configuration logic out of your controller actions.
Controller actions generally use Controller::set() to create a context that View uses to render the view layer. Because of the conventions that CakePHP uses , you don't need to create and render the view manually. Instead, once a controller action has completed, CakePHP will handle rendering and delivering the View.
FormHelper contains supportive library files of form for performing the different operations in CakePHP . The FormHelper focuses on efficiently developing of the form so, that validation, re-population, and design can be simplified. In FormHelper, there are various tags of the form which we will use to create a form in the template folder.
Call Helper Function for using it on Controller in Cakephp 3 - call_helper_in_controller.php
Well, helpers are not thought to be used in controllers . They are designed to be used in views. So whenever this question arises, you have to ask yourself (or others) whether you are doing something wrong and if there is no better solution.