<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Plugin-specific styles, images, and javascript files</title>
	<atom:link href="http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-109842</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 11 Oct 2008 09:20:05 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-109842</guid>
		<description>@David: Yes, in theory plugins are mini-apps, in practice it is not (yet?) the case, at least not completely. There are no plugin-specific configuration files.

For the time being you have to use a workaround as shown in the link you posted, but you might consider to open an enhancement ticket for it (if there is not one already), maybe the devs will add such functionality to the core in a future version...</description>
		<content:encoded><![CDATA[<p>@David: Yes, in theory plugins are mini-apps, in practice it is not (yet?) the case, at least not completely. There are no plugin-specific configuration files.</p>
<p>For the time being you have to use a workaround as shown in the link you posted, but you might consider to open an enhancement ticket for it (if there is not one already), maybe the devs will add such functionality to the core in a future version&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Thalmann</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-109737</link>
		<dc:creator>David Thalmann</dc:creator>
		<pubDate>Fri, 10 Oct 2008 11:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-109737</guid>
		<description>@cakebaker: The idea of a plugin is to serve a fully working mini-app, which you can drop in your plugin folder and it should work as-is (may have some dependencies to other plugins, but nothing else!). This includes localization files, plugin specific routes, styles (&lt;- thank you for your blogpost ;) ).

As an example, my blog plugin:
&lt;code&gt;Router::connect(
    &#039;/blog/:id-:slug/*&#039;,
    array(
        &#039;plugin&#039; =&gt; &#039;blog&#039;,
        &#039;controller&#039; =&gt; &#039;blog&#039;,
        &#039;action&#039; =&gt; &#039;view&#039;)
    ),
    array(
        &#039;pass&#039; =&gt; array(&#039;id&#039;),
        &#039;id&#039; =&gt; &#039;[0-9]+&#039;
    );
&lt;/code&gt;

This code fragment belongs not to the application, it belongs to the plugin, so it should be in the plugin.
(where should I place it? And how should cake realize anyway, that I&#039;ve defined a route somewhere outside of routes.php?)

Same problem with localization.

I mean, it&#039;s not a big deal to do it for each plugin, but a cake-plugin would be way more a plugin in my understanding of what a plugin should be.

I&#039;ve just found a interesting post:
http://groups.google.com/group/cake-php/browse_thread/thread/74484afe7da5c1f0#msg_f8adaf31f5980fd1
Thats may what i&#039;ve been looking for :)</description>
		<content:encoded><![CDATA[<p>@cakebaker: The idea of a plugin is to serve a fully working mini-app, which you can drop in your plugin folder and it should work as-is (may have some dependencies to other plugins, but nothing else!). This includes localization files, plugin specific routes, styles (&lt;- thank you for your blogpost ;) ).</p>
<p>As an example, my blog plugin:<br />
<pre><code>Router::connect(
    '/blog/:id-:slug/*',
    array(
        'plugin' =&gt; 'blog',
        'controller' =&gt; 'blog',
        'action' =&gt; 'view')
    ),
    array(
        'pass' =&gt; array('id'),
        'id' =&gt; '[0-9]+'
    );</code></pre>
<p>This code fragment belongs not to the application, it belongs to the plugin, so it should be in the plugin.<br />
(where should I place it? And how should cake realize anyway, that I&#8217;ve defined a route somewhere outside of routes.php?)</p>
<p>Same problem with localization.</p>
<p>I mean, it&#8217;s not a big deal to do it for each plugin, but a cake-plugin would be way more a plugin in my understanding of what a plugin should be.</p>
<p>I&#8217;ve just found a interesting post:<br />
<a href="http://groups.google.com/group/cake-php/browse_thread/thread/74484afe7da5c1f0#msg_f8adaf31f5980fd1" rel="nofollow">http://groups.google.com/group/cake-php/browse_thread/thread/74484afe7da5c1f0#msg_f8adaf31f5980fd1</a><br />
Thats may what i&#8217;ve been looking for :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-109649</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 09 Oct 2008 18:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-109649</guid>
		<description>@David: Hm, what do you mean with &quot;in-plugin routes&quot;? Can you provide an example of what you try to accomplish?</description>
		<content:encoded><![CDATA[<p>@David: Hm, what do you mean with &#8220;in-plugin routes&#8221;? Can you provide an example of what you try to accomplish?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Thalmann</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-109419</link>
		<dc:creator>David Thalmann</dc:creator>
		<pubDate>Wed, 08 Oct 2008 15:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-109419</guid>
		<description>Thank you for this post, was looking for a solution like that for a long time.
Any idea how to define in-plugin routes? because for example an user-auth plugin just _wont_ work without routes.
and other hard-coded stuff like i18n/l10n? or should i &#039;fix&#039; this with some kind of helper-modules?

(I&#039;m on a plugin-based cms with cakephp, but the plugin-part of the documentation isn&#039;t very helpfully for newbies like me ;) )</description>
		<content:encoded><![CDATA[<p>Thank you for this post, was looking for a solution like that for a long time.<br />
Any idea how to define in-plugin routes? because for example an user-auth plugin just _wont_ work without routes.<br />
and other hard-coded stuff like i18n/l10n? or should i &#8216;fix&#8217; this with some kind of helper-modules?</p>
<p>(I&#8217;m on a plugin-based cms with cakephp, but the plugin-part of the documentation isn&#8217;t very helpfully for newbies like me ;) )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-101758</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 07 Aug 2008 15:40:22 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-101758</guid>
		<description>@Matt: Thanks for your comment! And yes, it would be nice, if the helpers would automatically look in the correct plugin folders for the referenced resources. 

Oh, just saw you started a new site, good luck with it ;-)</description>
		<content:encoded><![CDATA[<p>@Matt: Thanks for your comment! And yes, it would be nice, if the helpers would automatically look in the correct plugin folders for the referenced resources. </p>
<p>Oh, just saw you started a new site, good luck with it ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Huggins</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-101732</link>
		<dc:creator>Matt Huggins</dc:creator>
		<pubDate>Thu, 07 Aug 2008 07:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-101732</guid>
		<description>Ahh, thanks for the heads up.  Previously, this could be done by saving the images under the vendors/css folder of the plugin, and referencing the image as img/name.jpg from a CSS file.  My images stopped showing up, and I couldn&#039;t figure out how to resolve it.

I like the fact that I can use the vendors/img folder now, but I hate the fact that I have to directly reference the plugin name.</description>
		<content:encoded><![CDATA[<p>Ahh, thanks for the heads up.  Previously, this could be done by saving the images under the vendors/css folder of the plugin, and referencing the image as img/name.jpg from a CSS file.  My images stopped showing up, and I couldn&#8217;t figure out how to resolve it.</p>
<p>I like the fact that I can use the vendors/img folder now, but I hate the fact that I have to directly reference the plugin name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-101632</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 05 Aug 2008 14:53:11 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-101632</guid>
		<description>@David: Thanks for your comment!

Yes, there is some overhead involved when serving files in that way. On the other hand it is convenient to have all plugin-related files in the plugin folder. In the end it depends on your project whether the overhead is acceptable or you have to look for a different solution.

Anyway, I have to have a look at your &lt;a href=&quot;http://cakeforge.org/projects/attm&quot; rel=&quot;nofollow&quot;&gt;attm project&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@David: Thanks for your comment!</p>
<p>Yes, there is some overhead involved when serving files in that way. On the other hand it is convenient to have all plugin-related files in the plugin folder. In the end it depends on your project whether the overhead is acceptable or you have to look for a different solution.</p>
<p>Anyway, I have to have a look at your <a href="http://cakeforge.org/projects/attm" rel="nofollow">attm project</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Persson</title>
		<link>http://cakebaker.42dh.com/2008/08/04/plugin-specific-styles-images-and-javascript-files/comment-page-1/#comment-101578</link>
		<dc:creator>David Persson</dc:creator>
		<pubDate>Mon, 04 Aug 2008 16:13:53 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=650#comment-101578</guid>
		<description>Problem is that it&#039;s superslow to output images and friends by php. On each request to a plugin image or css a part of the framework is invoked, objects are being built, ... 

I prefer to use the django approach of separating media from the framework and letting apache itself handle all the static files. That what it&#039;s for.

I&#039;m preparing a plugin in the attm cakeforge repo to be used with cake introducing an enhanced/conventionalized media directory schema plus a helper to handle the urls.</description>
		<content:encoded><![CDATA[<p>Problem is that it&#8217;s superslow to output images and friends by php. On each request to a plugin image or css a part of the framework is invoked, objects are being built, &#8230; </p>
<p>I prefer to use the django approach of separating media from the framework and letting apache itself handle all the static files. That what it&#8217;s for.</p>
<p>I&#8217;m preparing a plugin in the attm cakeforge repo to be used with cake introducing an enhanced/conventionalized media directory schema plus a helper to handle the urls.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

