@Miles: The OP wrote his 'simple' tag wrong and therefore created this
thread, which then mentioned how to use a method in CakePHP that the
OP could not work out.  I answered a support query, didn't expect to
be repremanded for it :)    I personally love using this function as
it adds my view specific javascript to $scripts_for_layout which I
then echo in a specific place in my layout, instead of it being echoed
instantly in my view ... much neater IMO!

@nkoss: I did not give you syntax for $this->Html->scriptBlock() I
gave you syntax for $this->Javascript->codeBlock(), after all we are
dealing with javascript here so it makes sense that we're using the
Javascript helper, and I can assure you it works just fine.

HTH, Paul

On Sep 21, 2:36 pm, Vinícius Moraes de Araújo
<vinizinmor...@gmail.com> wrote:
> If u want the script on body`s page, just remove this `inline` => false.
>
>  $this->Html->scriptBlock("document.getElementById(\"OpFirstName
> \").focus();");
>
> Atenciosamente,
>
> Vinícius Moraes
>
> 2011/9/21 nkoss <nkos...@gmail.com>
>
>
>
>
>
>
>
> > Webbedit...
> > AHA...but your code did not work since scriptBlock is a method of the
> > Html helper. When I used...
> >        $this->Html->scriptBlock("document.getElementById(\"OpFirstName
> > \").focus();",
> >                 array('inline'=>false, 'safe'=>false));
> > it placed the code in the <HEAD> so not very useful
>
> > Miles...
> > I think I agree with you
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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

Reply via email to