Jump to content

markitup & jquery editor with cakePHP "Undefined variable: markitup"


farkewie

Recommended Posts

Hi,

 

I have just started creating my site using the cakePHP framework, I have created the basic blgging function but i am trying to use a different editor instead of just a textarea.

 

I am following the tutorial here http://bakery.cakephp.org/articles/view/markitup-jquery-universal-markup-editor-helper

 

i have the following files inplace.

 

app/views/helpers/markitup.php

app/webroot/js/jquery/jquery.js

 

and the folder

 

app/webroot/js/markitup

 

and in my add.ctp i have the following code

 

<?php
echo $form->create('Posts');
echo $form->input('Posts.article'); 
echo $markitup->create("Add markItUp! to the textarea", 'Posts.article');
echo $form->end('Validate');
?>

 

and when i try to veiw the form i get

 

 

Notice (8): Undefined variable: markitup [APP\views\posts\add.ctp, line 14]

 

Code | Context

$___viewFn = "D:\xampp\htdocs\cake\app\views\posts\add.ctp"

$___dataForView = array()

$loadHelpers = true

$cached = false

$loadedHelpers = array(

"Html" => HtmlHelper

HtmlHelper::$tags = array

HtmlHelper::$base = "/cake"

HtmlHelper::$here = "/cake/posts/add"

HtmlHelper::$params = array

HtmlHelper::$action = "add"

HtmlHelper::$data = NULL

HtmlHelper::$_crumbs = array

HtmlHelper::$__docTypes = array

HtmlHelper::$helpers = NULL

HtmlHelper::$webroot = "/cake/"

HtmlHelper::$themeWeb = NULL

HtmlHelper::$plugin = NULL

HtmlHelper::$namedArgs = NULL

HtmlHelper::$argSeparator = NULL

HtmlHelper::$validationErrors = NULL

HtmlHelper::$__tainted = NULL

HtmlHelper::$__cleaned = NULL

HtmlHelper::$_log = NULL,

"Form" => FormHelper

FormHelper::$helpers = array

FormHelper::$fieldset = array

FormHelper::$__options = array

FormHelper::$fields = array

FormHelper::$requestType = "post"

FormHelper::$base = "/cake"

FormHelper::$webroot = "/cake/"

FormHelper::$themeWeb = NULL

FormHelper::$here = "/cake/posts/add"

FormHelper::$params = array

FormHelper::$action = "add"

FormHelper::$plugin = NULL

FormHelper::$data = NULL

FormHelper::$namedArgs = NULL

FormHelper::$argSeparator = NULL

FormHelper::$validationErrors = NULL

FormHelper::$tags = array

FormHelper::$__tainted = NULL

FormHelper::$__cleaned = NULL

FormHelper::$_log = NULL

FormHelper::$Html = HtmlHelper object,

"Session" => SessionHelper

SessionHelper::$helpers = NULL

SessionHelper::$__active = true

SessionHelper::$valid = false

SessionHelper::$error = false

SessionHelper::$_userAgent = "71bf328b13f8d947cf41575feaa5db80"

SessionHelper::$path = "/"

SessionHelper::$lastError = NULL

SessionHelper::$security = NULL

SessionHelper::$time = 1234564632

SessionHelper::$sessionTime = false

SessionHelper::$watchKeys = array

SessionHelper::$id = NULL

SessionHelper::$_log = NULL

SessionHelper::$base = "/cake"

SessionHelper::$webroot = "/cake/"

SessionHelper::$here = "/cake/posts/add"

SessionHelper::$params = array

SessionHelper::$action = "add"

SessionHelper::$data = NULL

SessionHelper::$themeWeb = NULL

SessionHelper::$plugin = NULL

)

$helper = "Session"

$camelBackedHelper = "session"

$html = HtmlHelper

HtmlHelper::$tags = array

HtmlHelper::$base = "/cake"

HtmlHelper::$here = "/cake/posts/add"

HtmlHelper::$params = array

HtmlHelper::$action = "add"

HtmlHelper::$data = NULL

HtmlHelper::$_crumbs = array

HtmlHelper::$__docTypes = array

HtmlHelper::$helpers = NULL

HtmlHelper::$webroot = "/cake/"

HtmlHelper::$themeWeb = NULL

HtmlHelper::$plugin = NULL

HtmlHelper::$namedArgs = NULL

HtmlHelper::$argSeparator = NULL

HtmlHelper::$validationErrors = NULL

HtmlHelper::$__tainted = NULL

HtmlHelper::$__cleaned = NULL

HtmlHelper::$_log = NULL

$form = FormHelper

FormHelper::$helpers = array

FormHelper::$fieldset = array

FormHelper::$__options = array

FormHelper::$fields = array

FormHelper::$requestType = "post"

FormHelper::$base = "/cake"

FormHelper::$webroot = "/cake/"

FormHelper::$themeWeb = NULL

FormHelper::$here = "/cake/posts/add"

FormHelper::$params = array

FormHelper::$action = "add"

FormHelper::$plugin = NULL

FormHelper::$data = NULL

FormHelper::$namedArgs = NULL

FormHelper::$argSeparator = NULL

FormHelper::$validationErrors = NULL

FormHelper::$tags = array

FormHelper::$__tainted = NULL

FormHelper::$__cleaned = NULL

FormHelper::$_log = NULL

FormHelper::$Html = HtmlHelper object

$session = SessionHelper

SessionHelper::$helpers = NULL

SessionHelper::$__active = true

SessionHelper::$valid = false

SessionHelper::$error = false

SessionHelper::$_userAgent = "71bf328b13f8d947cf41575feaa5db80"

SessionHelper::$path = "/"

SessionHelper::$lastError = NULL

SessionHelper::$security = NULL

SessionHelper::$time = 1234564632

SessionHelper::$sessionTime = false

SessionHelper::$watchKeys = array

SessionHelper::$id = NULL

SessionHelper::$_log = NULL

SessionHelper::$base = "/cake"

SessionHelper::$webroot = "/cake/"

SessionHelper::$here = "/cake/posts/add"

SessionHelper::$params = array

SessionHelper::$action = "add"

SessionHelper::$data = NULL

SessionHelper::$themeWeb = NULL

SessionHelper::$plugin = NULL

 

echo $form->create('Posts');

  echo $markitup->create("Add markItUp! to the textarea", 'Posts.article');

 

include - APP\views\posts\add.ctp, line 14

View::_render() - CORE\cake\libs\view\view.php, line 662

View::render() - CORE\cake\libs\view\view.php, line 376

Controller::render() - CORE\cake\libs\controller\controller.php, line 774

Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 248

Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 211

[main] - APP\webroot\index.php, line 88

 

Fatal error: Call to a member function create() on a non-object in D:\xampp\htdocs\cake\app\views\posts\add.ctp on line 14

 

 

oh and finnaly my post.php file

 


<?php

class Post extends AppModel
{
    var $name = 'Post';
    var $helpers = array('Markitup');
    var $validate = array(
	'title' => array(
		'rule' => 'notEmpty'
	),
	'body' => array(
		'rule' => 'notEmpty'
	)

);

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.