开发者

problem in shorthand php tag of files in cake php

开发者 https://www.devze.com 2023-03-27 04:38 出处:网络
I have this simple code: <html> <head> <title>My Cake Blog Application</title> <?=$html->css(\'styles\');?>

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消