CakePHP Helpers - Integrating helpers on helpers

how to use helper function in view in cakephp
cakephp form helper
cakephp element
cakephp html->link
checkbox in cakephp
cakephp form helper templates
cakephp javascript
cakephp javascript helper

I created my own helper on CakePHP 2.x that uses the HtmlHelper but it doesn't work, here is the code

class NavHelper extends Helper {

   public $helpers = array("Html", "Javascript");

   function __construct($config = array()) {

}

function link($label, $options) {
    if($this->perms(array('controller'=>$options['controller'],'action'=>$options['action']))) {
        $html = '<a ';
        foreach($options as $label => $value) {
            if($label != 'action' || $label != 'controller') {
                $html .= " {$label}=\"{$value}\" ";
            }
            $html .= " href='".$this->Html->url(array('controller'=>$options['controller'],'action'=>$options['action']))."'>".$label."</a>";
        }

        return $html;
    }
    return '';
}

Fatal error: Call to a member function url() on a non-object in C:\Bitnami\wappstack-5.5.28-0\apache2\htdocs\pokeadmin_v2\app\View\Helper\NavHelper.php on line 17

But $this->Html->url worked perfectly on CakePHP 1.3 but on CakePHP 2.x won't work, also tried to use $this->Html = new HtmlHelper; with the following error:

Warning (4096): Argument 1 passed to HtmlHelper::__construct() must be an instance of View, none given, called in C:\Bitnami\wappstack-5.5.28-0\apache2\htdocs\pokeadmin_v2\app\View\Helper\NavHelper.php on line 11 and defined [CORE\Cake\View\Helper\HtmlHelper.php, line 161

I also checked the documentation but no luck.

You broke the constructor, in two ways that is, first it doesn't accept the arguments required by its parent (view and configuration), and it also never invokes the parent, which is where the required helper map is initialized.

If you don't need the constructor, don't override it, and if you do, make sure that you accept the required arguments and that you pass them on to the parent constructor.

public function __construct(View $view, $settings = array()) {
    parent::__construct($view, $settings);
    // ...
}

See also Cookbook > Views > Helpers > Using and Configuring Helpers

Helpers - 3.8, How to load helpers and use those helpers, and outline the simple steps for creating your own custom helpers. CakePHP includes a number of  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. For more information on the helpers included in CakePHP, check out the chapter for each helper:

Just found that i can use Router::url for the same action as $this->Html->url

Helpers, CakePHP features a number of helpers that aid in view creation. formatting text​, times and numbers, and can even integrate with popular JavaScript libraries. This chapter will show you how to create your own helpers, and outline the basic tasks CakePHP’s core helpers can help you accomplish. CakePHP features 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. For more information on the helpers included in CakePHP, check out the chapter for each helper:

This might be a bit off subject, but it might help someone new to CakePHP who happens to stumble across this on here;

You can load Helpers directly on the AppController as such:

namespace PluginName\Controller;

use App\Controller\AppController as BaseController;
use Cake\Http\Response;
use Cake\Http\ServerRequest;

class AppController extends BaseController
{
    public $helpers = ['PluginName.HelperName'];

    // ....
}

Reference: https://book.cakephp.org/3.0/en/views/helpers.html#loading-helpers-on-the-fly

Helpers - 2.x, Using and Configuring Helpers; Using Helpers; Callback methods Helpers are the component-like classes for the presentation layer of your  Helpers CakePHP features 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 integrate with popular JavaScript libraries.

Practical CakePHP Projects, You may need to create your own helper or tweak an existing helper class to provide This helper will print a variable and insert a new break after printing. MVC package called a plugin, which you can integrate into other Cake applications. CakePHP Form Helper for Parsley.js automatic validation integration. This helper will automatically read validation rules from active form model and assign field attributes accordingly. Compatible with Cake 2.4.7+. Feel free to make any code/docs contributions or post any issues.

Building PHP Applications with Symfony, CakePHP, and Zend Framework, for Symfony2 A bunch of useful helpers only Zend_view Additional template engines Smarty3 available as plug-in Smarty and Dwoo can be integrated Smarty  Creating Helpers¶ If a core helper (or one showcased on Cakeforge or the Bakery) doesn’t fit your needs, helpers are easy to create. Let’s say we want to create a helper that could be used to output a specifically crafted CSS-styled link you need in many different places in your application.

PHP, MySQL, & JavaScript All-in-One For Dummies, For example, in CakePHP, the link() helper method generates an <a href> tag based on the controller and method names you supply to it. That makes it easier​  Helpers support a number of callback methods. These callbacks allow you to hook into the various view lifecycle events and either modify existing view content or perform other application specific logic. The events are not implemented by this base class, as implementing a callback method subscribes a helper to the related event.