I’ve been reading on this quite some time…and i’m puzzled –
Can you help on what is the difference between:
Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl.'/css/some-file.css');
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/some-file.css
Is it a performance issue, or just different syntax?
Thanks,
Danny
registerCssFilealways registers the file between the<head>tags, even if you call it somewhere in a view.This is helpful if you care about HTML validation (a
<link>in<body>is invalid), but still want to include a CSS file in a view.registerCssFileactually aids performance, because the CSS is registered only when you want it (and need it).