You are here: Re: Too match text I think. « All PHP « IT news, forums, messages
Re: Too match text I think.

Posted by Steve on 10/14/06 14:02

".:[ ikciu ]:." <no@mail.com> wrote in message
news:egq7cq$qve$1@news.dialog.net.pl...
| Hmm Steve <no.one@example.com> wrote:
|
| > how do you overcome the memory wasted in pulling in ONE FILE when
| > only a small portion of it is needed?
|
| ofc if you will have other data on each language your way is better but
this
| won't be multilanguage site
| multilanguage means all data exists in each version - translation
|
| > first, you DON'T need templates AT ALL. a simple translation function
| > suffices:
| > <h1><?= language::translate(phrases::$helloWorld, language::en_us)
| > ?></h1>
|
| ofc, i didn't think about real template (Smarty or something like it),
only
| the way what i showed you. there is no sense to to insert php code in
| layout, when your function will change name or nuber of parameters you
will
| have to change it everywhere, when you will use replace function for
insert
| data you will do it in one place ...
| i think you don't get it, do it what you want ..... EOT

you don't understand what we've said...at all. the ONLY parameter that
changes is language::en_us. phrases::$helloWorld always stays the same. it
is a constant that points to a record in a table that has infinite number of
translations. the text returned is the one that is flagged language::en_us.
if using a file instead of a db, you're simply require_once a file named
language.en_us and parsing getting the $helloWorld text.

and, it makes perfect sense to put the php code in the layout. there is NO
difference between switching {someVariablePlaceHolder} in a 'template' than
doing the same thing with $someVariablePlaceHolder.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация