CSS Linking

0 views
Skip to first unread message

wlasson

unread,
Mar 3, 2009, 3:34:43 PM3/3/09
to Photon Framework
Hey Guys,

I was wondering what the proper way is to link a CSS style sheet that
I have in a tag page. Right now if i try to pass in a URL like: ../
pages/css/default.css Photon will try to parse that URL and return
that there is not a page there. Maybe there is someway to make it skip
trying to parse that URL and just do a relative path to a file?

Thanks,

Wade

alvaro

unread,
Mar 3, 2009, 3:59:05 PM3/3/09
to Photon Framework
I usually do urls like this:
/index.php/home/user

and set a baseUrl config of '/index.php' when I instantiate
PageControllerApp. Like this:
$app = new PageControllerApp(array(
'pagesDir' => APPROOT.'/pages',
'baseUrl' => '/index.php',
'urlHandler' => new SimpleUrlHandler(array(
'baseUrl' => '/index.php'
)),
'viewRenderer' => new PTagViewRenderer(array(
'templateDir' => APPROOT.'/pages',
'compileDir' => APPROOT.'/compile',
'tagsDir' => APPROOT.'/tags'
))
));


If I want to have urls that look like:
/home/user

i use this rule:
RewriteRule ^/([^.]+)$ /index.php/ [NC,L]

which will rewrite any request that doesn't have a dot in it. Either
setup should allow you to include css and js files directly without
triggering the framework code.

Alvaro

wlasson

unread,
Mar 3, 2009, 4:05:30 PM3/3/09
to Photon Framework
That makes more sense, I must have had my rewrite rule messed up
somehow.

Thanks for the help!
Reply all
Reply to author
Forward
0 new messages