Re: Moo.fx problems
The head helper was exactly what I needed. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Moo.fx problems
lobby with me :-) KemenAran wrote: I frequently need to use functions like those provided by this Head Helper. I developped a similar class for a personnal framework some time ago, and really missed these features in CakePHP, until you pointed me to this Helper. Is there any chances to see it included in a future release of CakePHP ? Olivier Percebois-Garve wrote: May I advice you the excellent Head Helper made by rossoft ? http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/ By using it, you'll be able to call your _javascript_ files in your views instead of in the layout. This way it gets loaded only when its needed and the head helper take care of putting it where it should. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Moo.fx problems
I frequently need to use functions like those provided by this Head Helper. I developped a similar class for a personnal framework some time ago, and really missed these features in CakePHP, until you pointed me to this Helper. Is there any chances to see it included in a future release of CakePHP ? Olivier Percebois-Garve wrote: > May I advice you the excellent Head Helper made by rossoft ? > http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/ > > By using it, you'll be able to call your javascript files in your views > instead of in the layout. > This way it gets loaded only when its needed and the head helper take > care of putting it where it should. > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Moo.fx problems
May I advice you the excellent Head Helper made by rossoft ? http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/ By using it, you'll be able to call your javascript files in your views instead of in the layout. This way it gets loaded only when its needed and the head helper take care of putting it where it should. Olivvv in your app/views/asdf/index.thtml : $head->register_js('moo.fx/moo.fx/scripts/prototype.lite.js'); $head->register_js('moo.fx/moo.fx/scripts/moo.fx.js'); $head->register_js('moo.fx/moo.fx/scripts/moo.fx.pack.js'); $head->register_jsblock(' var myDivs = document.getElementsByClassName('stretcher'); var myLinks = document.getElementsByClassName('stretchtoggle'); var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true}); '); ?> martin wrote: > I'm just getting started with JavaScript and I really like the moo.fx > accordion effect, but I'm having some problems getting moo.fx to work. > > At first I thought the problem might be with the website I am > developing, so I put all of that in a temporary folder and extracted > cake 1.1.4.3104 into my server root. After configuring, I create the > following three files: > > > --app/views/layouts/default.thtml-- > > > > link('prototype')?> > link('moo.fx')?> > link('moo.fx.pack')?> > > > > > > > > > --app/controllers/asdf_controller.php-- > > class AsdfController extends AppController > { > var $uses = array(); > var $helpers = array('Javascript'); > function index() > { > ; > } > } > ?> > > > > --app/views/asdf/index.thtml-- > > Hello World! > Hello World > > Accordion Text 1 > > Hello World 2 > > Accordion Text 2 > > > > var myDivs = document.getElementsByClassName('stretcher'); > var myLinks = document.getElementsByClassName('stretchtoggle'); > var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true}); > > > > Firefox gives me the following 3 javascript errors: > > (1) > Error: unexpected end of XML source > Source File: http://127.0.0.1/js/moo.fx > Line: 5, Column: 163 > Source Code: > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > And moo.fx looks like this when I click on the link to in in the > firefox error console: > > > > > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > (2) > Error: unexpected end of XML source > Source File: http://127.0.0.1/js/moo.fx.pack > Line: 5, Column: 163 > Source Code: > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > And moo.fx.pack looks like this when I click on the link to in in the > firefox error console: > > > > > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > > (3) > Error: fx is not defined > Source File: http://127.0.0.1/asdf/index/ > Line: 18 > > > I am assuming that this all means that moo.fx is trying to generate a > page, and this is causing errors with cake... does anyone know how to > work around this and get it working? Am I doing something wrong? I've > tried adding the javascript links in the view file, instead of in the > layout, but that didn't help either, and I haven't had this problem > linking other js libraries. Thanks in advance! > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Moo.fx problems
Put var $helpers = array('Javascript'); in your app_controller.php Also make sure the moo.fx files are at the right place. Moo.fx is cool. Have fun. martin wrote: > I'm just getting started with JavaScript and I really like the moo.fx > accordion effect, but I'm having some problems getting moo.fx to work. > > At first I thought the problem might be with the website I am > developing, so I put all of that in a temporary folder and extracted > cake 1.1.4.3104 into my server root. After configuring, I create the > following three files: > > > --app/views/layouts/default.thtml-- > > > > link('prototype')?> > link('moo.fx')?> > link('moo.fx.pack')?> > > > > > > > > > --app/controllers/asdf_controller.php-- > > class AsdfController extends AppController > { > var $uses = array(); > var $helpers = array('Javascript'); > function index() > { > ; > } > } > ?> > > > > --app/views/asdf/index.thtml-- > > Hello World! > Hello World > > Accordion Text 1 > > Hello World 2 > > Accordion Text 2 > > > > var myDivs = document.getElementsByClassName('stretcher'); > var myLinks = document.getElementsByClassName('stretchtoggle'); > var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true}); > > > > Firefox gives me the following 3 javascript errors: > > (1) > Error: unexpected end of XML source > Source File: http://127.0.0.1/js/moo.fx > Line: 5, Column: 163 > Source Code: > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > And moo.fx looks like this when I click on the link to in in the > firefox error console: > > > > > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > (2) > Error: unexpected end of XML source > Source File: http://127.0.0.1/js/moo.fx.pack > Line: 5, Column: 163 > Source Code: > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > And moo.fx.pack looks like this when I click on the link to in in the > firefox error console: > > > > > Fatal error: Call to a member function on a non-object in > C:\Program > Files\xammp\xampp\htdocs\app\views\layouts\default.thtml on line > 3 > > > (3) > Error: fx is not defined > Source File: http://127.0.0.1/asdf/index/ > Line: 18 > > > I am assuming that this all means that moo.fx is trying to generate a > page, and this is causing errors with cake... does anyone know how to > work around this and get it working? Am I doing something wrong? I've > tried adding the javascript links in the view file, instead of in the > layout, but that didn't help either, and I haven't had this problem > linking other js libraries. Thanks in advance! > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---