I'm trying to use the HeadHelper[1] (v. 0.41). But I'm getting a strange behaviour.
Maybe I mess something but I can't get what. I want to add a custom css to a view. Even if I added to controller, layout and view, I can't get the css link in the rendered page. See the bottom for code snippets. Some tips? Thanks Davide 1. http://cakeforge.org/snippet/detail.php?type=snippet&id=56 //*********** //controller class UsersController extends AppController{ var $name="Users"; var $helpers = array("Html","Error","MyTime","Head"); //*********** //layout <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="it"> <head> <title><?=$title_for_layout?></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="/css/main.css"> <?php if(isset($head)) echo $head->print_registered();?> </head> <body> //*********** //view <?php $head->register_css("users_add"); ?> <h1>Nuovo Utente</h1> <div class="spacing"> //*********** //the resulting page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="it"> <head> <title> :: accedi</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="/css/main.css"> <script type="text/javascript"><!-- --></script></head> <body> <div id="container"> <div id="header"> <h1>
signature.asc
Description: OpenPGP digital signature
