0

So What I want to do is use a javascript called nicEdit.js in this one app, but don't want it used in all app that uses the "default.ctp" template.

  1. I've added the Js to /webroot/js/nicEdit.js
  2. Based on this tutorial "http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html", I have added "public $helpers = array('Js' => array('nicEdit'));" at the beginning of my Controller.
  3. I did a "view source" on my browser to see where the js is being loaded and I don't see it anywhere.

What am I missing?

1 Answer 1

1

To include a script on your page you can use the HTMLHelper in either a layout or a view, like this:

<?php
echo $this->Html->script('nicEdit');
?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.