你在找什麼叫做HeadStyle
查看幫手。其手冊文檔可以在here找到。
的HeadStyle
助手的API是將所有的Head*
視圖助手保持一致,這樣的工作(以下假設你是在一個viewscript):
// Putting styles in order:
// These methods assume the a string argument containing the style rules.
// place at a particular offset:
$this->headStyle()->offsetSetStyle(100, $customStyles);
// place at end:
$this->headStyle()->appendStyle($finalStyles);
// place at beginning
$this->headStyle()->prependStyle($firstStyles);
// Or capturing a block of styles
<?php $this->headStyle()->captureStart() ?>
body {
background-color: <?php echo $this->bgColor ?>;
}
<?php $this->headStyle()->captureEnd() ?>
注意,你不包括任何<style>
標籤這個輸入。這是由助手本身產生的。 然後,在你的佈局,只需echo
助手,你想它的輸出:
<head>
<?php echo $this->headLink() ?>
<?php echo $this->headStyle() ?>
</head>
請澄清你所說的「內部樣式表」的意思。 – hobodave 2009-07-24 02:41:21
編輯的問題,以澄清內部樣式表 – Marcel 2009-07-24 02:47:27