CodeIgniter Forums
dompdf as helper instead of plugin - CI 2.x - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: dompdf as helper instead of plugin - CI 2.x (/thread-42253.html)



dompdf as helper instead of plugin - CI 2.x - El Forum - 06-01-2011

[eluser]uk81[/eluser]
Hi guys.

I have a question.
I´m using CI 1.7.x with the dompdf plugin. It was very easy because just putting the third-party code (which comes as a directory with many files) in a directory at /system/plugins/.

Now since Codeigniter 2.0.0 the plugin/ directory was removed. The documentation says:
Quote:Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.

So I have to use dompdf as a helper. But where is suggested to put dompdf files, the subdirectories ...?
I think it is not nice to create a directory /application/helper/dompdf/
Or is this what you suggest?

Thanks for your answers! Smile


dompdf as helper instead of plugin - CI 2.x - El Forum - 06-01-2011

[eluser]uk81[/eluser]
I changed my code now in that way, that dompdf is a helper.
I do it in the same way as for the plugins (s. the wiki: http://codeigniter.com/wiki/PDF_generation_using_dompdf/ ) but in the /application/helper/ directory.

Just put dompdf there in a extra directory called "dompdf" and rename the "to_pdf_pi.php" to "to_pdf_helper.php".

Now it works.


But would be nice to get answer anyway for the question if it is like intended or if there is a "better" way to use a external library.

Thanks for all suggestions.

/Ulf


dompdf as helper instead of plugin - CI 2.x - El Forum - 06-01-2011

[eluser]Rok Biderman[/eluser]
It works as intended, plugins are deprecated in favor of helpers, so all is as it should be. No need to do it any other way, imo.