On Jan 18, 3:22 pm, "2000Man" <[EMAIL PROTECTED]> wrote:
Yes, I'd rather solve it within the framework and 'merge' /app/webroot
with /app/plugins/<pluginName/webroot.
Like the way /vendors/js is being 'merged' with the real webroot..
Hi 2000man,
This was actually discussed quite recently (in the " Container for
models,controllers,... -> "extensions"" thread)
See https://trac.cakephp.org/ticket/1897 for the changes (in principle)
I would propose.
Would mean that /css/name_of_plugin/plugin_specific_file.css returns
/app/plugins/name_of_plugin/webroot/js/plugin_specific_file.css if it
exists (and doesn't match anything in either the app or generic vendors
folders)
In addition/alternatively/In the mean time:
If you add the following to your plugins "home" controller (the one of
the same name as the plugin)
******
function css () {
$db =& ConnectionManager::getDataSource('default');
$db->fullDebug = false;
$this->autoLayout = false;
$this->viewPath = '../webroot/css';
header('Content-type: text/css');
$this->_cacheMe();
$this->render(join(DS, $this->params['pass']));
Configure::write('debug',0);
}
function js () {
$db =& ConnectionManager::getDataSource('default');
$db->fullDebug = false;
$this->autoLayout = false;
$this->viewPath = '../webroot/js';
$this->_cacheMe();
header('Content-type: text/javascript');
$this->render(join(DS, $this->params['pass']));
Configure::write('debug',0);
}
function _cacheMe () {
header("Date: " . date("D, j M Y G:i:s ") . 'GMT');
header("Content-Type: text/css");
header("Expires: " . gmdate("D, j M Y H:i:s", time() + YEAR) . "
GMT");
header("Cache-Control: cache"); // HTTP/1.1
header("Pragma: cache"); // HTTP/1.0
}
******
Would mean that /name_of_plugin/css/plugin_specific_file.css (or
/NameOfPlugin/css/plugin_specific_file.css) returns
/app/plugins/name_of_plugin/webroot/js/plugin_specific_file.css if it
exists.
Note the slightly different Urls for each technique.
HTH,
AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :) You may get your answer quicker by asking on
the IRC Channel (you can access it with just a browser
here:http://irc.cakephp.org).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---