cakePHP QR Code Helper

Posted by Max on Wed, Dec 22 2010 14:44:00

I wrote this little Helper to simplify the creation of QR Codes in a cakePHP app. It uses the Google Chart API, therefore Codes are generated on the fly and not saved on the server.

It can be found in my GIT repository.

Includes functions to create QR codes for:

  • free text
  • contacts
  • email sending
  • calendar events
  • Geolocations
  • Android Market Searches
  • MMS sending
  • SMS sending
  • Telephone calls
  • URLs

Some samples

echo $this->Qrcode->text('muXe rocks!');

would create this QR code with the content "muXe rocks!"

QR code with simple text

And this:

echo $this->Qrcode->event(
	array(
		'summary' => 'Highnachten',
		'start' => '20101224T180000',
		'end' => '20101224T235900',
		'location' => 'Berlin',
		'description' => 'Time to celebrate!'
	),
	array(
		'size' => '500x500',
	)
);

would create the following QR code, which contains an iCal event.

Sample QR code for an event

Posted in cakePHP

3 Comments

paul said on Dec 23, 2010
Yes, works perfect! very nice. thanks for sharing.
Axel said on May 17, 2011
Works perfectly! And it was very easy to install.. Thank you!!
keyross said on Jul 26, 2011
Hola me podrias ayudar con el funcionamiento del ayudante

Add new comment