Hi,
If my Yii app is located in this directory http://localhost/public_html/mywebapp/
how do I tell my code below that I wanted it to automatically be set under the dir above?
<?php
/**
* Extending CLinkPager so that we can give it a custom css file
*/
class LinkPager extends CLinkPager
{
public $cssFile = '/css/pager.css';
}
seenivasan
(Chellamnivas)
January 20, 2013, 11:55am
2
Dear Friend
If the following is the path of pager.css
http://localhost/public_html/mywebapp/css/pager.css
Then the following would work
public $cssFile = 'css/pager.css';
Regards.
konapaz
(Konapaz)
January 20, 2013, 11:59am
3
Hi corbeeresearch
You could use also
public $cssFile = Yii::app()->baseUrl . '/css/pager.css';
I get this error
Parse error: syntax error, unexpected ‘(’, expecting ‘,’ or ‘;’ in /var/www/public_html/tots/protected/components/LinkPager.php on line 8
seenivasan:
Dear Friend
If the following is the path of pager.css
http://localhost/public_html/mywebapp/css/pager.css
Then the following would work
public $cssFile = 'css/pager.css';
Regards.
Unfortunately, I tried it, and didn’t work.
seenivasan
(Chellamnivas)
January 20, 2013, 12:10pm
6
Sorry about that
Anywhere in my application, I can do the following to get contents of main.css in css folder.
$file="css/main.css";
echo file_get_contents($file);
Regards.
konapaz
(Konapaz)
January 20, 2013, 12:24pm
7
I get this error
Parse error: syntax error, unexpected ‘(’, expecting ‘,’ or ‘;’ in /var/www/public_html/tots/protected/components/LinkPager.php on line 8
Try this
public $cssFile;
public function init()
{
$this->cssFile = Yii::app()->baseUrl . '/css/pager.css';
return parent::init();
}
Thanks, that does the trick!