How to use tinymce with CakePHP? - cakephp

I am totally new to CakePHP.
I want Tinymce editor in my webpage.
I have followed the link: Using TinyMCE with CakePHP
As per this link I have added JavaScript helper in my AppController file but it shows an error: "Helper class javascriptHelper could not be found."
Also confused that where to place this code:
<?php if(isset($javascript)):
echo $javascript->link('tiny_mce/tiny_mce.js');
endif; ?>
I am using CakePHP 2.9.3 & TinyMCE 4.0.6
can anyone help me by specifying the step to configure TinyMCE.

Did you notice the publish date of that article you linked? :)
You can use this plugin for CakePHP 2.x.

Related

Can't install DebugKit in cakePHP

I set up the DebugKit in cakephp but I'm getting this error:
Error: DebugKit.ToolbarComponent could not be found.
Error: Create the class ToolbarComponent below in file:
C:\xampp\htdocs\eperformance\app\Plugin\DebugKit\Controller\Component\ToolbarComponent.php
<?php class ToolbarComponent extends Component { } ?>
Can anyone help me with this?
My ng case:
cakephp ver.2.6.4 and
debugkit ver.2.2 or master
My successful case:
cakephp ver.2.6.1 and
debugkit ver.2.2
Hope it helps you.
Possible walk through:
In bootstrap use this line CakePlugin::load('DebugKit'); OR CakePlugin::loadAll();
Use this link to download debug kit click here
Follow the README.md file in above link

CakePHP Twitter plugin

Appologies if this is something obvious I've missed.
I'm trying to use this Cake plugin to add a twitter feed to my cake app (just display my latest tweet). I've followed the docs in the readme but I get this:
Missing Controller
Error: Twitter.UsersController could not be found.
Error: Create the class UsersController below in file: C:\wamp\www\mysite\app\Plugin\Twitter\Controller\UsersController.php
Heres what I've done so far (as the readme instructs):
Cloned all the files into app/Plugin/Twitter/
Rename Config/twitter.default.php to Config/twitter.php
Updated the config file with my twitter app keys
Visited mysite/twitter/twitter/connect - which gives me the above error.
The readme mentions that the plugin uses - http_socket_oauth, another cake plugin, I trust that this is included in this plugin and that I dont have to install that plugin aswel?
Could someone point me in the right direction?
Thank you

Working with Cakephp and TinyMCE Editor

I am using cakephp 2.3 version. I tried to get tinymce editor by reference of Helper TinyMCE for CakePHP 2 [http://bakery.cakephp.org/articles/galitul/2012/04/11/helper_tinymce_for_cakephp_2].
At the end
Error: The application is trying to load a file from the jquery-1 plugin
is showing. I cound solve this error. Please help me to solve this error.
Thanks in advance.
You really shouldn't need a plugin for this as TinyMCE is a plugin. Just include TinyMCE in your template and in your JavaScript attach it to textareas that require the editor. I do this using the jQuery version of TinyMCE and attach it to any textarea with the class "wysiwyg" (which I add to the relevant form elements.

CakePHP 2 can't find FireCake using Debug_kit

I have been attempting to use CakePHP 2.0 and most of it works pretty well, however I have not been able to get console logging working with FireCake. I have FireBug 1.8.3 and FirePHP 0.6.2 installed in Firefox 6.0.2 and my old Cake 1.3 project works fine. For CakePHP 2.0 I downloaded the new version of DebugKit, put it in Plugins, added this to my AppController in Controllers folder:
App::import('Vendor', 'DebugKit.FireCake');
class AppController extends Controller {
public $components = array('Cookie', 'DebugKit.Toolbar', 'RequestHandler', 'Session');
and this in my bootstrap
CakePlugin::load('DebugKit');
and in core
Configure::write('debug', 2);
and then put this in one of my controller actions
FireCake::log($msg);
which generates an error like this
Fatal error: Class 'FireCake' not found in C:\Users\foo\Documents\Websites\cakephp-2.0.0.35\numbering\Controller\AppController.php on line 29
I can't figure out anything I might have missed from the instructions, so is there something duh-obvious I might be overlooking? Or some extra import that is necessary? Any help would be appreciated, thanks.
Matt
[edit]
I should add that the DebugKit menu appears as expected and functions, the problem is just FireCake.
The documentation was incorrect for CakePHP v 2.0. This is now required:
App::import('Lib', 'DebugKit.FireCake');
I believe you should use
App::uses('FireCake', 'DebugKit.Lib');
if you are on CakePHP 2.2 or higher.

CakePHP 2.0 Plugin URL

Trying to get CakePHP work with subfolders for Controllers, Views, or Models is not really working and from what I've read I need to use "Plugins". Right now I have the following folder structure:
/app/Plugin/Manager/
/Controller
CandyController.php
/Models
/View
/Candy
viewCandy.ctp
ManagerAppController.php
ManagerAppModel.php
When I try and set my url to: http://localhost/Manager/Candy/viewCandy/123. I get the error message: "ManagerController does not exist". Why is CakePHP not picking up that it should look in the Manager plugin folder?
Now that 2.0 has been released the docs are fleshed out a bit more. This is described in the Plugin section of the cookbook.
They suggest putting this in bootstrap.php instead of routes.php:
CakePlugin::loadAll(); // Loads all plugins at once
CakePlugin::load('ContactManager'); //Loads a single plugin
Here is the solution:
Go to /app/Config/routes.php and add the line CakePlugin::load(array('YourPluginName')); after the line CakePlugin::routes();. In my case it was line 40.
Basically CakePHP 2.0 doesn't automatically load plugins. I think that's fine and dandy, but there isn't really any documentation for this.

Resources