Hi,
I'm trying to create a helper class to render a javascript calendar for
my forms. This calendar uses an external javascript file and css, so I
decided to include HeadHelper to avoid touching the layout.
According to the manual, it should suffice to include $helpers = array
(..., 'Head', 'Calendar') in my controller and $helpers = ('Html',
'Javascript', 'Head') in my CalendarHelper, but it doesn't. I'm getting
the following PHP error:
-------------------------------
Notice: Undefined property: CalendarHelper::$head in
C:\www\forge\htdocs\news\views\helpers\calendar.php on line 8
Fatal error: Call to a member function register_jsblock() on a
non-object in C:\www\forge\htdocs\news\views\helpers\calendar.php on
line 8
--------------------------------
calendar.php looks like this:
--------------------------------
<?php
class CalendarHelper extends Helper {
var $helpers = array('html','javascript','head');
function __construct () {
$this->head->register_jsblock($javascript);
$this->head->register_css("calendar/calendar");
$this->head->register_js("calendar/GCappearance");
$this->head->register_js("calendar/GurtCalendar");
}
function calendar ($fieldName,$htmlAttributes=array(),$return=false) {
/* To be implemented */
}
}
-----------------------------------
Could anyone help me on this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---