Monday, June 14, 2010

Cakephp - Adding meta data to a website

meta(string $type, string $url = null, array $attributes = array(), boolean $inline = true)

This method is handy for linking to external resources like RSS/Atom feeds and favicons. Like css(), you can specify whether or not you'd like this tag to appear inline or in the head tag using the fourth parameter.


$html->meta(
'favicon.ico',
'/favicon.ico',
array('type' => 'icon')
);?> //Output (line breaks added)




$html->meta(
'Comments',
'/comments/index.rss',
array('type' => 'rss'));
?>

//Output (line breaks added)

Wednesday, June 9, 2010

Jquery : Attaching an event to multiple elements at one go

var a = $("#a");
var b = $("#b");
var combined = a.add(b);

Now u can use

combined.click(function () { /* */ });


this can be used in situation where u want to add same validation to two different forms