You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For an internal implementation of Minify integrated with our own MVC
framework, we needed to load a custom controller for use with our views,
and using the naming convention for our framework for the controller class
Minify would fail, attempting instead to load Minify_Controller_etcetc.
The fix for this was of course to override serve() in our Minify extended
class (which we had already created as a wrapper as a matter of good
practice), but copying and pasting the entirety of serve(), which does
quite a few things and has changed between releases of Minify, seems the
wrong way to do this to override one simple little autoload method.
As a proposed patch (attached) I've moved the controller loading to a
separate static method in Minify and call this from within serve(),
allowing anyone that wishes to do so to just override this loadController()
method.
Not sure if this is solving an edge-case here, but it feels like a better
way to do this overall.
You do not need to extend Minify to do this. Simply create a controller object (load
it however you want) and pass it as the first parameter to serve(). It's easiest,
but not required, to make your controller a subclass of Minify_Controller_Base.
{{{
$myController = MyFramework::factory('MinifyController');
Minify::serve($myController, $options);
}}}
serve() only uses its loader if you pass a string. I'm sorry this isn't well-
documented yet; here's the phpdoc line that specifies this:
http://code.google.com/p/minify/source/browse/tags/release_2.1.0/min/lib/
Minify.php#135
Originally reported on Google Code with ID 65
Reported by
1stvamp
on 2008-10-29 09:39:28- _Attachment: [Minify.patch](https://storage.googleapis.com/google-code-attachments/minify/issue-65/comment-0/Minify.patch)_
The text was updated successfully, but these errors were encountered: