unexpected T_CONSTANT_ENCAPSED_STRING

前端 未结 4 1462
死守一世寂寞
死守一世寂寞 2021-01-13 18:56

Am using CakePHP running on XAMPP Server with PHP 5.3.5 i keep getting the error message syntax error, unexpected T_CONSTANT_ENCAPSED_STRING Line 38

Line 38 is \'P

4条回答
  •  悲&欢浪女
    2021-01-13 19:31

    Change it from

     link(ife(
    '$post['Post']['published'] == 1', 
    'Published',
    'Unpublished'),
    '/posts/'.ife('$post'['Post']['published'] == 1',
    'disabled','enable').'/'.$post['Post']['id']
    );
    ?>
    

    to

    link(ife(
    $post['Post']['published'] == 1', 
    'Published',
    'Unpublished),
    '/posts/'.ife($post['Post']['published'] == 1',
    'disabled','enable).'/'.$post['Post']['id']
    );
    ?>
    

    You just needed to remove the single quote right before $post

提交回复
热议问题