note 72506 added to function.define
| From: | NIMA | Date: | Mon, 22 Jan 2007 06:29:33 +0000 |
| Subject: | note 72506 added to function.define | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122025@lists.php.net to get a copy of this message | ||
imagine you want to allow your software users to tralsate your software for their use, you can
create a separate file containing messages only using define() then all your users need to do is
translating the messages in define() line.
for example create a file only for language strings:
define(WELCOME, "Hello world", true);
define(END, "Goodbye world", true);
then in template files, the language file should be included and the message can be printed using
this:
<?=welcome?> // it echoes "Hello World"
or <?=end?> // it echoes "Goodbye world"
remember you users should not necessarily know php and the "echo" command, so they can
simply use <?=welcome?> or <?=end?>
----
Server IP: 203.199.124.111
Probable Submitter: 202.177.225.189
----
Manual Page -- http://www.php.net/manual/en/function.define.php
Edit -- https://master.php.net/note/edit/72506
Del: integrated -- https://master.php.net/note/delete/72506/integrated
Del: useless -- https://master.php.net/note/delete/72506/useless
Del: bad code -- https://master.php.net/note/delete/72506/bad+code
Del: spam -- https://master.php.net/note/delete/72506/spam
Del: non-english -- https://master.php.net/note/delete/72506/non-english
Del: in docs -- https://master.php.net/note/delete/72506/in+docs
Del: other reasons-- https://master.php.net/note/delete/72506
Reject -- https://master.php.net/note/reject/72506
Search -- https://master.php.net/manage/user-notes.php