KodiCMS-Kohana / cms

A new version of KodiCMS 14.0.0 with composer moved to the KodiCMS company.
https://github.com/KodiCMS/kodicms
131 stars 35 forks source link

Invalid value of $PUBLICPATH when outside of CMS #356

Closed gestern closed 9 years ago

gestern commented 9 years ago

According to bootstrap.php:

define('PUBLICPATH',            DOCROOT . 'public' . DIRECTORY_SEPARATOR);

$PUBLICPATH should be /public/, but it is not working as supposed when I tried to invoke inside of my layout: /. Code:

echo Meta::factory($page)
                ->js('jquery', $PUBLICPATH.'js/jquery-latest.min.js');

Is there any chance to get right value of /public folder through $<something>?

butschster commented 9 years ago

Correct PUBLICPATH, without $ echo Meta::factory($page)->js('jquery', PUBLICPATH.'js/jquery-latest.min.js');

gestern commented 9 years ago

Thanks @butschster, right now PUBLICPATH contains absolute path on a web server, like /var/www/.../public/ but it doesn't have to be, I'd like to get /public/. Is it possible?

butschster commented 9 years ago

BASE_URL . 'public/' You can create new plugin, create file init.php and there place code like this https://github.com/KodiCMS-Kohana/demo-site/blob/master/init.php#L4

define('PUBLIC_URL', BASE_URL . 'public/');
gestern commented 9 years ago

Thank you for your support.