Re: Include Js file in layouts

2007-02-28 Thread GreyCells

Hi CraZyLeGs

The HeadHelper /functionality/ is now in the core - not the code
itself.

Put: $javascript-link(array('jquery.js', app.js), false); in your
view.ctp and e($scripts_for_layout); in the head section of your
layout.ctp and you get the same functionality as HeadHelper. (Note the
second arg 'false' on $javascript-link).

~GreyCells


On Feb 21, 9:51 am, CraZyLeGs [EMAIL PROTECTED] wrote:
 The head helper isn't part of the  core.
 it was written by rossoft and it's available in his blog

 On Feb 20, 9:33 am, GreyCells [EMAIL PROTECTED] wrote:

  If you're using 1.2, then take a look here:

 http://cake.insertdesignhere.com/posts/view/17

  The HeadHelper functionality is implemented in the core.

  ~GreyCells

  On Feb 20, 8:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

   I want to include javascript file in layout.It is possible? if it is,
   how to include javascript file.

   If i include like this

   app/views/layouts/index.thtml

   head
   titleUntitled-1/title
   meta http-equiv=Content-Type content=text/html;
   charset=iso-8859-1
   /head

   script src='../js/shal.js' language='javascript'/script

   it is not working.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Include Js file in layouts

2007-02-21 Thread CraZyLeGs

The head helper isn't part of the  core.
it was written by rossoft and it's available in his blog

On Feb 20, 9:33 am, GreyCells [EMAIL PROTECTED] wrote:
 If you're using 1.2, then take a look here:

 http://cake.insertdesignhere.com/posts/view/17

 The HeadHelper functionality is implemented in the core.

 ~GreyCells

 On Feb 20, 8:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  I want to include javascript file in layout.It is possible? if it is,
  how to include javascript file.

  If i include like this

  app/views/layouts/index.thtml

  head
  titleUntitled-1/title
  meta http-equiv=Content-Type content=text/html;
  charset=iso-8859-1
  /head

  script src='../js/shal.js' language='javascript'/script

  it is not working.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Include Js file in layouts

2007-02-20 Thread [EMAIL PROTECTED]

I want to include javascript file in layout.It is possible? if it is,
how to include javascript file.

If i include like this

app/views/layouts/index.thtml

head
titleUntitled-1/title
meta http-equiv=Content-Type content=text/html;
charset=iso-8859-1
/head

script src='../js/shal.js' language='javascript'/script

it is not working.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Include Js file in layouts

2007-02-20 Thread AD7six



On Feb 20, 9:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I want to include javascript file in layout.It is possible? if it is,
 how to include javascript file.

 If i include like this

 app/views/layouts/index.thtml

 head
 titleUntitled-1/title
 meta http-equiv=Content-Type content=text/html;
 charset=iso-8859-1
 /head

 script src='../js/shal.js' language='javascript'/script

 it is not working.

How could it ;). Your current location changes depending on if you
have parameters or not in the url, and you have specificed a relative
path - In any event it would be cleaner to use the javascript helper
to generate the script link (search the manual/group if you don't know
what that means)

HTH,

AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Include Js file in layouts

2007-02-20 Thread Steniskis

You put your js files in a directory js inside the webroot directory

Then you have  helpers to add.

In the controller, you include
var $helpers = array('html', 'javascript');

and in your layout, you put this for example :

echo $html-charsetTag('UTF-8');

$head-js('prototype');
$head-js('scriptaculous.js?load=effects');
$head-js('controls');

$head-js('datepicker');
$head-js('zebra_tables');
$head-js('listes');
$head-js('script');
$head-js('jquery');
$head-js('thickbox');
$head-js('common');
if (ereg(MSIE, getenv(HTTP_USER_AGENT))){
$head-css('ie6_or_less');
}
$head-css('page');
$head-css('main');
$head-css('thickbox');
$head-css('datepicker');

Cheers
Steniskis


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Include Js file in layouts

2007-02-20 Thread Dr. Tarique Sani

On 2/20/07, Steniskis [EMAIL PROTECTED] wrote:

 You put your js files in a directory js inside the webroot directory

 Then you have  helpers to add.

 In the controller, you include
 var $helpers = array('html', 'javascript');

var $helpers = array('html', 'javascript','head','util');

you need to add the head helper and util for the calls to $head- to work...


 and in your layout, you put this for example

 $head-js('prototype');
 $head-js('scriptaculous.js?load=effects');
 $head-js('controls');

For some reason calls to $head- do not work in layout

I would suggest that investigate html and javascript helpers before
you venture with head helper.

http://manual.cakephp.org/chapter/helpers

HTH

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Include Js file in layouts

2007-02-20 Thread Steniskis

Don't forget the helper head.
Sorry
Steniskis



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Include Js file in layouts

2007-02-20 Thread GreyCells

If you're using 1.2, then take a look here:

http://cake.insertdesignhere.com/posts/view/17

The HeadHelper functionality is implemented in the core.

~GreyCells

On Feb 20, 8:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I want to include javascript file in layout.It is possible? if it is,
 how to include javascript file.

 If i include like this

 app/views/layouts/index.thtml

 head
 titleUntitled-1/title
 meta http-equiv=Content-Type content=text/html;
 charset=iso-8859-1
 /head

 script src='../js/shal.js' language='javascript'/script

 it is not working.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---