views:

345

answers:

3

in all my views i have a login/register (cake)form.

my question: can i use the file cache engine with <cake:nocache>form</ cake:nocache>

1.) open url "www.domain.com/home"
2.) cachefile generated
3.) look perfect
4.) refresh (f5)
5.) error (when debug=1):

Parse error: parse error in C:\xampp\htdocs\cake_1.2.3.8166\app\tmp\cache\view \cake_1_2_3_8166_home.php on line 752

cachefile -> line 752 -> </html>

cakephp: 1.2.3.8166
example:

<cake:nocache>
<?
$user = $session->read("user");
if(!$user){ //$user true or false
    echo "login:";
    echo $form->create('AdminUser', array('action' =>'login_load'));
    echo $form->input('email',array('label'=>false));
    echo $form->input('password',array('label'=>false));
    echo $form->submit('Login', array('id'=>'login'));
    echo $form->end();
}else{
    echo "hello user!";
}?>
</cake:nocache>
A: 

this was my mistake:
Parse error: parse error in C:\xampp\htdocs\cake_1.2.3.8166\app\tmp\cache\view \cake_1_2_3_8166_home.php on line 752 cachefile -> line 752 -> </html>
reason:

<cake:nocache>
    <?
       if($user){
         $user = $session->read("user");
     ?>
</cake:nocache>
   <? echo "test";?>    
<?}?>

correct: ( cache not close the if{} )

<cake:nocache>
<?
    if($user){
       $user = $session->read("user");
       echo "test";
    }
?>
</cake:nocache>

but the central question still undissolved:
can i use the file cache engine with

<cake:nocache>form</cake:nocache>
hansi meier
A: 

it's a cakephp bug. cake google groups

hansi meier
A: 

The dev state at https://trac.cakephp.org/ticket/6034 CakePHP does not support using the form helper from within tags at this time.

michaelc