Your Ad Here

Sunday, January 1, 2012

How to make Dojo parse the html elements on page on load ?

Dojo can parse the elements in the html and convert to Dojo or Dijit elements.

Include  parseOnLoad config parameter after the script include tag.

    djConfig="parseOnLoad:true">

For some reasons if this is not worked try the below js code after dojo include 
tag.

<script type="text/javascript">
dojo.config.parseOnLoad=true;

Wednesday, July 28, 2010

php- Cakephp how to load helper in a component

Helpers can be loaded in to components and use as class objects

function index() {
App::import('Helper', 'Html'); // loadHelper('Html'); in CakePHP 1.1.x.x
$html = new HtmlHelper();
debug($html->link('Cake!', 'http://cakephp.org'));
}

Thursday, July 15, 2010

Php - creating table of values with fixed column from an array of values

Easily create tables

Use array_chunk($arrvalues, 2);

Array
(
[0] => Array
(
[0] => a
[1] => b
)

[1] => Array
(
[0] => c
[1] => d
)

[2] => Array
(
[0] => e
)

)


http://www.php.net/manual/en/function.array-chunk.php

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)