у меня есть эта таблица:
+----+-------+-----+-------+
| id | clave | lan | texto |
+====+=======+=====+=======+
| 1 | hi | 1 | Hello |
| 3 | hi | 2 | Hola |
с помощью этого метода
function get_texto_clave($clave){
/* Checks the session language, finds and returns texto for the given clave*/
$clave = htmlspecialchars($clave);
$lan = detectarIdioma();
$temporal = new texto($clave, $lan);
if($temporal->exists()==true){
return $temporal->get_texto();
}else{
return $clave;
}
}
ИСПОЛЬЗОВАНИЕ:
допустим, мы хотим напечатать форму:
<form>
<?php echo get_texto_clave('form_enter_login'); ?>
<input type="text" />
<?php echo get_texto_clave('form_enter_password'); ?>
<input type="password" />
<input type="submit" value="<?php echo get_texto_clave('form_enter_login'); ?>" />
</form>
Как видите, для этой простой формы мы уже выполнили 3 запроса ....
вопрос: как я могу кешировать эти результаты? Вы предлагаете другую реализацию?