problem in shorthand php tag of files in cake php
I have this simple code:
<html>
<head>
<title>My Cake Blog Application</title>
<?=$html->css('styles');?>
</head>
<body>
<div id="container">
<div id="content">
<?=$content_for_layout;?>
</div>
</div>
</body>
</html>
I saved it in app/views/layouts name it to default.ctp the output in browser only shows me css('styles');
also I have styles.css in app/webroot/css
it is not working in my browser then I tried this s开发者_开发知识库tring for begin and close:<?php echo();?>
again not worked
<html>
<head>
<title>My Cake Blog Application</title>
<?php=$html->css('styles'); echo();?>
</head>
<body>
<div id="container">
<div id="content">
<?php=$content_for_layout; echo();?>
</div>
</div>
</body>
</html>
Either use full tags as you already found out or enable short tags in php.ini: How to enable PHP short tags?
<html>
<head>
<title>My Cake Blog Application</title>
<?php echo $html->css('styles'); ?>
</head>
<body>
<div id="container">
<div id="content">
<?php echo $content_for_layout; ?>
</div>
</div>
</body>
</html>
精彩评论