i’m trying to configure the CLinkPager and the CGridView widgets through the WidgetFactory. Everything works fine, but wasn’t able to figure out how to get base URL path to correctly set the cssFile attributes.
Unfortunetly the getBaseUrl() methode is only available after the application is initialized and therefore not accessible in the config. As this method is only utilizing the $_SERVER var, it might be a good idea to make it available as a static method in the YiiBase helper class?!
So far the only solution to get the base path i found is this:
rtrim(dirname($_SERVER['SCRIPT_NAME']),'\\/')
It’s part of the getBaseUrl() method code. I don’t know if this works in every environment, but it does work with apache.
If somebody found a better solution i would be glad to see it.
When I try set the cssfile or any other property in config file, it shows an error that ‘Property “CWebApplication.widgetFactory” is read only.’ . For example, following code shows the error.