CakePHP export html/data to PowerPoint Format - php

I am facing a problem with CakePHP 2.X. My client wants to export some data generated from a mysql database, to a powerpoint (.ppt or .pptx) format(s) in a specific template. I allready knew the PHPPowerPoint is at the alpha status so I don't want to make a plugin for Cake based on this. I also found
this! little gem but It works only for Windows PHP and I am using a linux based server (CentOs).
It is possible to create an xml or an html, encoded with something compatible of powerpoint format and just put the right php headers at the top? And what is this something?
or a better solution is there an api or a plugin something to work for all the platforms?
And could this plugin or api is compatible for Cake?
Thank you

PHPPowerPoint seem to be at a good place now, check out their GitHub: PHPPowerpoint
Installation instructions: http://phppowerpoint.readthedocs.org/en/latest/installing.html

Related

How to add OAuth2 Server on a CakePHP 3 plugin

I am working on a plugin in CakePHP3 and I need to create a simply Oauth 2.0 Server API that allows to do a simple CRUD on the users' table and create sessions when needed.
I have done some research here in StackOverflow and it seems that the best choice would be
https://github.com/uafrica/oauth-server
Now, I have tried to make it work according to the doc in the repository but since it will be a plugin, not the core of the application I do not understand how it is supposed to work and which file I need to update.
Would somebody be so kind to give me the list of steps I need to follow and the actual files that need to be updated?
Many Thanks in advance
The uafrica/oauth-server project is woefully out of date. It requires v4.1 of league/oauth2-server, which is now currently at v7.2. Version 5 of that project was completely rewritten and is not backwards compatible with v4.x.
I don't think there's an out-of-the-box CakePHP 3 plugin that works with the current version of league/oauth2-server.
You'll have to either build your own plugin from scratch, or try to hack the uafrica/oauth-server project to get it work with league/oauth2-server.

Print docs in PDF format in Yii

I have made an application in Yii. Now as per my application requirement I have to make them print in PDF format. I searched over Yii docs but did not got any docs about converting file into printable PDF format. So any help and suggestions will be highly appreciable.
Look into WkHtmlToPdf:
http://code.google.com/p/wkhtmltopdf/
It uses Webkit's rendering engine to make PDFs from HTML / CSS. It's the best library out there that I've found and I've done a bunch of research.
Edit:
Mike on the Yii forum has already built an OO wrapper for WkHtmlToPdf and just released a Yii extension for it.
I have recently used MPDF for a project. It allows you to convert HTML output into PDF format. If you are looking for something simple this might be what you are looking for. Personally, I find it easier to work with HTML/CSS for layout than PDF boxes. I am not sure just how well it scales with complex layouts, though.
Yii also supports using Zend modules. You can use Zend_Pdf if you so choose.
See this documentation page on how to integrate third-party libraries with your Yii code.
Either way, as has already been mentioned, there are tons of PDF libraries available for PHP.
You should search for php libraries to do that. Link to one of them - http://www.tcpdf.org/
I have had great success using fpdf - http://www.fpdf.org/
Unfortunately this feature is not part of Yii. You can try TCPDF, though. http://www.tcpdf.org/
TCPDF lets you parses your HTML output to PDF document. The PDF document can be output in your server or to the user as a direct download.
Hers the extension to create PDF files.
Yii2-PDF

File upload in with Lithium framework

How does Lithium framework file upload work with MySQL? I can find only tutorials and information with MongoDB. Tried to do that with MySQL but failed, upload doesn't work.
Can someone explain how it works with simple example?
Do it like you would using plain PHP.
MongoDB has GridFS where you can store files, which can be done in MySQL too (using BLOB) but is not recommended. Use the filesystem instead move_uploaded_file().
I'm working on a plugin, much like paperclip for rails. it's called li3_attachable and can be found here https://github.com/sandelius/li3_attachable.
It's not ready yet but I hope it should be stable this weekend. I've also added some docs in the wiki.

generation of multiple reports and zipping in codeigniter php

I want to generate multiple pdf reports on click of single print button and zip all the pdf's and store it in a folder.
Any help please. I need this functionality in my project.
According to https://stackoverflow.com/questions/560583/which-is-the-best-pdf-library-for-php
, the best pdf php library is FPDF.
They also mention that Zend has a nice PDF Lib. If you are using CodeIgniter you may wish to use the Zend library, as Zend libraries work nicely inside of CodeIgniter. (A simple Google search will show up several tutorials on using Zend libs as CI libs).
Someone on the CI Forums has instructions on using FPDF with CodeIgniter:
http://codeigniter.com/forums/viewthread/45365/
As for the second part of your question, wrapping data in a zip file is easily done with with CodeIgniter Zip Encoding library as detailed in the user guide.

Integrating iCalendar in Moodle

I am working on a Moodle project and I have downloaded and installed the latest build(1.9) on my system. I'm using this framework for the very first time so presently trying to get familiar with the environment and the documentation.
My need is to embed an iCal kinda calendar on Moodle's front page using the PHP iCalendar API. I downloaded the latest version of PHP iCalendar but kinda needed some help figuring things out further. I am trying to build a plug-in sorta thing which allows you to put a custom-built calendar (in place of the regular Moodle calendar) on your Moodle site.
Has anyone ever worked with something similar before? Any suggestions?
On moodle.org, there is a change request for this feature in the Moodle Tracker that you might want to follow:
Calendar: IMPORT or Subscribe to iCal feed into Moodle calendar
.
You could try looking at the module development text. It could be fairly easy to do, but I haven't really worked with moodle that much. http://moodle.org/
This feature is currently a feature request in Moodle, but may take several version before it comes it becomes a core feature see the feature request here http://tracker.moodle.org/browse/MDL-16660.
The current workaround seems to be to use one of the commonly avaliable web based calendar system to import your ical feed and then inserting a html snippet into moodle to view it.
The obvious example would be to use a public Google calendar to do this but there is also:
http://assignaday.4teachers.org/
http://www.localendar.com/elsie
Reference:
http://moodle.org/mod/forum/discuss.php?d=82855

Categories