url management

i was reading the post regarding url management located http://www.yiiframework.com/doc/guide/topics.url#parameterizing-routes

to my understanding i need to use $url=$this->createurl in the controller, then pass the variable to the rendered page

but lets say i have a header in my layout file (layouts/main.php) that i want to use the createurl method, which controller calls the layout main.php

Hm I am not pretty sure to understand your question. But anyway, usually, I’ll use Yii::app()->createUrl() to create url, rather than use Controller…

that works great, but what im concerned about is i have 8 or so links in my header wouldnt there be a more rescource friendly way instead ov calling that method over and over every time the page is called?

well usually I create a global function to shorten the createUrl() function…

see here : http://www.yiiframework.com/doc/cookbook/31/