• Entries (RSS)
  • Comments (RSS)

CakePHP – link / include JavaScript files in layouts

Posted by | Posted in JavaScript Libraries, OpenSource, PHP, Resources, Tips and Tricks, Tutorials | Posted on 29-12-2008

Tagged Under : , , , , , , , , , , ,

Create (or modify the) file

app/app_controller.php

add this code

class AppController extends Controller {
	var $helpers = array('Html', 'Form', 'Javascript');
}

CakePHP 1.2 allows you to define a reference to a Javascript file which is then added to the head section of the generated code. For this purpose the variable $scripts_for_layout has to be added to the layout:

<head>
	< ?php echo $scripts_for_layout; ?>
</head>

In the view you can now link to the Javascript file with:

$javascript->link('script.js', false);
// OR you can simply use $javascript->link('script.js');

jQuery Error

Posted by | Posted in JavaScript Libraries, News, OpenSource | Posted on 22-09-2008

Tagged Under : , , ,

jQuery Error

jQuery Error, originally uploaded by asim.zeeshan.

I tried opening the jQuery documentation website for a reference and it was running into errors. I strongly feel that there should be an offline documentation with every release.

Learning the Yahoo User Interface Library

Posted by | Posted in Flickr, JavaScript Libraries, OpenSource, PHP, Resources, Reviews | Posted on 14-04-2008

Tagged Under : , , ,

Yahoo User Interface Library

The cool book that i just bought today.

I was previously working with Prototype and Scriptaculous (and im very good at it) and then jQuery. Most recently i have also worked with mootools because i had to create a component for Joomla 1.5.

This week, i had to do something with sliders and had to look into each one of these in more detail. Found out that YUI is far better (and advanced).

If you want to sneak peak before purchasing the book, then visit the official YUI blog and read Sample Chapter from Dan Wellman’s “Learning the Yahoo! User Interface Library”.

Note: Post comments and your criticism below.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes