Chaitanya Lakshmi
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook

Exaplin !, @ and % with Examples?

3/8/2012

0 Comments

 
!variable, which indicates that the text should be inserted as-is. This is useful for inserting variables into things like e-mail.
<?php
    $message = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => l(t('My account'), "user/$account->uid"))); 
?>

@variable, which indicates that the text should be run through check_plain, to escape HTML characters. Use this for any output that's displayed within a Drupal page.

<?php
    $title = t("@name's blog", array('@name' => $account->name));
?>

%variable, which indicates that the string should be HTML escaped and highlighted with theme_placeholder() which shows up by default as emphasized.

<?php
    $message = t('%name-from sent %name-to an e-mail.', array('%name-from' => $user->name, '%name-to' => $account->name));
?>
0 Comments



Leave a Reply.

    Archives

    April 2012
    March 2012
    February 2012

    Categor

    All
    Ajax
    Api
    Cross Site Scripting
    Css
    Curl
    Design Patterns
    Drupal
    Exception Handling
    Htaccess
    Html
    Javascript
    Jquery
    Json
    Linux
    Mysql
    Oops
    Php
    Regular Expressions
    Web 2.0
    Webservices
    Wordpress
    Xhtml

    RSS Feed

Powered by Create your own unique website with customizable templates.