On Apr 15, 2011, at 10:42, varai wrote:

> Can someone tell me what is the use of?
>                $this->Html->meta('icon');

Surely you could try it out yourself to discover what it does? :)

You could also read the documentation:

http://book.cakephp.org/view/1438/meta

Putting this command:

echo $this->Html->meta('icon');

into a view will cause CakePHP to output these tags:

<link href="/favicon.ico" type="image/x-icon" rel="icon" />
<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" />

The purpose of these tags is to inform the web browser where the page's favicon 
("favorite icon") is, which the browser might display to the left of the URL in 
the address bar, in the window title, in the tab title, and/or in the bookmarks 
(or "favorites") menu. Browsers that support favicons know that the default 
icon file is /favicon.ico so unless you want to change the icon's location, 
these tags are probably unnecessary, but perhaps useful in that they provide an 
indication that the document does have a favicon.


> Referring to the cakephp cookbook, page 274, in order to get rid of
> the many <? ?> and many echo() calls, i added the following code to
> app_helper.php under class AppHelper extends Helper:
> 
> function output($str){
>      echo($str);
> }
> 
> However, the above code doesn't seem to work.
> 
> what is wrong with the code? does anyone know?

First, note that echo is a language construct, not a function, hence it is not 
proper to use parentheses. That is, use "echo $str" not "echo($str)". See:

http://php.net/echo

Second, your function output() appears to be nothing more than a wrapper around 
echo, in which case, why not just use echo in the first place?

What is the problem you're trying to solve here -- why do you believe the many 
opening and closing php tags and the many echo calls are a problem?

Finally, "doesn't seem to work" doesn't provide us with any information that 
would enable us to help you. (Explain *how* it doesn't work: what did you 
expect to happen, and what did it do instead.)



-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to