Help w/ DebugKit - no toolbar

2009-01-26 Thread BenL

I'm attempting to use DebugKit per http://thechaw.com/debug_kit/wiki,
with cake_1.2.1.8004. I've downloaded debug_kit from
http://github.com/cakephp/debug_kit/tree/master and placed it into my
app/plugins directory.

After an initial hiccup with file permissions, I've hit a stumbling
block in that I don't have the toolbar on my DebugKit-enabled page. My
controller:



http://.../events/ returns the same content regardless of the
$components line.

I have the default debug level, 2 (i.e. I can see the SQL log), I'm
using Firefox 3 w/ Firebug and FirePHP installed.

What am I missing?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Rendering non-HTML: templates vs. elements

2009-01-26 Thread BenL

My app uses ical-like events and I'd like to make these events
available for subscription from Google Calendar, Apple iCal, etc. The
guide at http://www.365webapplications.com/2009/01/09/cakephp-calendar/
helped me set up iCalcreator as a Helper.

However I'm confused on use of a view template vs. element: from the
Cake doc, I would have expected to use a template that defines the
overall layout (in this case, it would be empty as iCalcreator's
render takes care of everything); then the view would create an
iCalcreator object from the data provided by the controller and render
it to $content_for_layout.

However, the 365webapplications approach invokes the controller action
via a requestAction in an element, the element then creates the
iCalcreator object renders it. No template is used. When I do this, I
find that the controller action gets called twice, and seems to get
cut off prematurely:

i.e. my controller and element (simplified):

controllers/events_controller.php:
helpers[] = 'ICal';  // pull in the i_cal helper
$this->Event->recursive = 0;// don't need associated data

$events = $this->Event->find('all');

// called via a requestAction?
if (isset($this->params['requested']))  {
echo "controllers/events_controller: requested";
return $events;
}

echo "controllers/events_controller, setting events";
$this->set('events', $events);
echo "controllers/events_controller, done";
}
}
?>

views/elements/events.ctp
";
$events = $this->requestAction('events/ical');
echo "views/elements/events.ctp 2";

$iCal->create();

echo "views/elements/events.ctp 3";
foreach($events as $e)
{
$iCal->addEvent(
$e['Event']['datestart'],
$e['Event']['dateend'],
$e['Event']['summary'],
$e['Event']['description']
);
}
$iCal->render();
echo "views/elements/events.ctp 4";
?>

views/events/ical.ctp:
";
//echo $this->element('events', array('cache'=>'+1 hour'));
echo $this->element('events');
echo "views/events/ical.ctp end";
?>


Now, when I call the action, I get:

controllers/events_controller, setting events

controllers/events_controller, done

views/events/ical.ctp start

views/elements/events.ctp 1

controllers/events_controller: requested

views/elements/events.ctp 2

views/elements/events.ctp 3

render>
BEGIN:VCALENDAR METHOD:PUBLISH ... :VEVENT END:VCALENDAR


element('events');'
in the view>

Is the above the best way to output non-HTML?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---