src/View/Helper/AssetsHelper.php
public function toggleField($selector = '.jsToggleField', $widget = 'JBZoo.FieldToggle', array $options = [])
    {
        $this->jqueryFactory();

        $this->Html->script('Core.admin/widget/field-toggle.js', $this->_setOptions([
            'alias'  => __FUNCTION__,
            'weight' => self::WEIGHT_WIDGET
        ]));

        $options = Hash::merge(['token' => $this->request->getCookie('csrfToken')], $options);
        $this->Js->widget($selector, $widget, $options);

        return $this;
    }
public function toggleField($selector = '.jsToggleField', $widget = 'JBZoo.FieldToggle', array $options = [])
    {
        $this->jqueryFactory();

        $this->Html->script('Core.admin/widget/field-toggle.js', $this->_setOptions([
            'alias'  => __FUNCTION__,
            'weight' => self::WEIGHT_WIDGET
        ]));

        $options = Hash::merge(['token' => $this->request->getCookie('csrfToken')], $options);
        $this->Js->widget($selector, $widget, $options);

        return $this;
    }
public function toggleField ( $ selector = '.jsToggleField' , $ widget = 'JBZoo.FieldToggle' , array $ options = [ ] ) { $ this -> jqueryFactory ( ) ; $ this -> Html -> script ( 'Core.admin/widget/field-toggle.js' , $ this -> _setOptions ( [ 'alias' => __FUNCTION__ , 'weight' => self :: WEIGHT_WIDGET ] ) ) ; $ options = Hash :: merge ( [ 'token' => $ this -> request -> getCookie ( 'csrfToken' ) ] , $ options ) ; $ this -> Js -> widget ( $ selector , $ widget , $ options ) ; return $ this ; }
Include toggle field js widget.

@param   string $selector
@param   string $widget
@param   array $options
@return  $this
Include toggle field js widget .