Why such poor documentation?
Now that my rant is over, it does look like dojotoolkit.org is being updated with current data. Perhaps, if Zend will continue to ship their framework with dojo, they can send some money their way to help resolve this issue. Otherwise, we may see a lot of people going back to Prototype, jQuery, or YUI.
To the subject at hand
Such a simple task, yet all documentation I could find is out of date. Here is how to create a tooltip with dojo and dijit in a Zend page template. In this case I added a tooltip to the search form.
<?php echo $this->headLink()->appendStylesheet('/styles/forms.css'); echo $this->dojo()->enable()->setLocalPath('/scripts/Dojo/dojo/dojo.js') ->addStyleSheetModule('dijit.themes.tundra') ->setDjConfigOption('parseOnLoad', true) ->requireModule('dijit.Tooltip'); ?> <div id="search_form"> <form id="search" onsubmit="return false"> Search: <input type="text" id="search_box" onkeypress="search(event)" /> <div dojoType="dijit.Tooltip" connectId="search_box" label="<div style='text-align:left'><b>To search for $ amount:</b><br /> Enter '<' or '>' and amount. <br /><br /><b>To search a state</b><br /> Enter the state name.<br /><br /><b>Everything else</b><br />Just enter the text to search for.</div>"></div> </form> </div>
What it does
When the user hovers over the search field a tooltip is shown, giving the user suggestions on how to use the search. Simple enough, right? Just require the correct modules, use “connectId” to assign the tooltip to the correct element, and use the label attribute to set the text of your tooltip. Was that so hard? Perhaps dojotoolkit.org should go to a wiki format so we developers can update it as we figure out how to use it.