Re: Moo.fx problems

2006-06-20 Thread martin

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
-~--~~~~--~~--~--~---



Moo.fx problems

2006-06-18 Thread martin

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--

html
head
?php echo $javascript-link('prototype')?
?php echo $javascript-link('moo.fx')?
?php echo $javascript-link('moo.fx.pack')?
/head
body
?php echo $content_for_layout?
/body
/html



--app/controllers/asdf_controller.php--

?php
class AsdfController extends AppController
{
var $uses = array();
var $helpers = array('Javascript');
function index()
{
;
}
}
?



--app/views/asdf/index.thtml--

h1Hello World!/h1
a class=stretchtoggleHello World/a
div class=strecher
Accordion Text 1
/div
a class=stretchtoggleHello World 2/a
div class=strecher
Accordion Text 2
/div

script type=text/javascript
var myDivs = document.getElementsByClassName('stretcher');
var myLinks = document.getElementsByClassName('stretchtoggle');
var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true});
/script


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:
bFatal error/b:  Call to a member function on a non-object in
bC:\Program
Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
b3/bbr /

And moo.fx looks like this when I click on the link to in in the
firefox error console:

html
head
br /
bFatal error/b:  Call to a member function on a non-object in
bC:\Program
Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
b3/bb


(2)
Error: unexpected end of XML source
Source File: http://127.0.0.1/js/moo.fx.pack
Line: 5, Column: 163
Source Code:
bFatal error/b:  Call to a member function on a non-object in
bC:\Program
Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
b3/bbr /

And moo.fx.pack looks like this when I click on the link to in in the
firefox error console:

html
head
br /
bFatal error/b:  Call to a member function on a non-object in
bC:\Program
Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
b3/bbr /


(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

2006-06-18 Thread Olivier Percebois-Garve

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--

 html
 head
 ?php echo $javascript-link('prototype')?
 ?php echo $javascript-link('moo.fx')?
 ?php echo $javascript-link('moo.fx.pack')?
 /head
 body
 ?php echo $content_for_layout?
 /body
 /html



 --app/controllers/asdf_controller.php--

 ?php
 class AsdfController extends AppController
 {
   var $uses = array();
   var $helpers = array('Javascript');
   function index()
   {
   ;
   }
 }
 ?



 --app/views/asdf/index.thtml--

 h1Hello World!/h1
 a class=stretchtoggleHello World/a
 div class=strecher
 Accordion Text 1
 /div
 a class=stretchtoggleHello World 2/a
 div class=strecher
 Accordion Text 2
 /div

 script type=text/javascript
   var myDivs = document.getElementsByClassName('stretcher');
   var myLinks = document.getElementsByClassName('stretchtoggle');
   var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true});
 /script


 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:
 bFatal error/b:  Call to a member function on a non-object in
 bC:\Program
 Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
 b3/bbr /

 And moo.fx looks like this when I click on the link to in in the
 firefox error console:

 html
 head
 br /
 bFatal error/b:  Call to a member function on a non-object in
 bC:\Program
 Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
 b3/bb


 (2)
 Error: unexpected end of XML source
 Source File: http://127.0.0.1/js/moo.fx.pack
 Line: 5, Column: 163
 Source Code:
 bFatal error/b:  Call to a member function on a non-object in
 bC:\Program
 Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
 b3/bbr /

 And moo.fx.pack looks like this when I click on the link to in in the
 firefox error console:

 html
 head
 br /
 bFatal error/b:  Call to a member function on a non-object in
 bC:\Program
 Files\xammp\xampp\htdocs\app\views\layouts\default.thtml/b on line
 b3/bbr /


 (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

2006-06-18 Thread KemenAran

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

2006-06-18 Thread Olivier Percebois-Garve




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  -~--~~~~--~~--~--~---