Articles tagged with "component"

Persistent Data

By Jesse Burns
I'm going to show you how to create persistent data in your apps using Components, regardless of which Controller you're using.

The reason why I wanted persistent data, was because I have my Website Preferences stored in a database. I didn't want to have to call that model in every Controller, so I learned a bit about Components and created one that can be called in my custom AppController, which would in turn call and query the SitePreference Model every time a Controller was used.

This is a 5 step process:
- Create The Table
- Create The Model
- Create The Component
- Execute The Component In Your Custom AppController
- Display The Data In Your 'default.thtml' File

Thanks to some feedback on #cakephp, I found out that using a Model in a Component is not a recommended practice and should be done only in special situations
[Read more]

Pagination Component

By Andy Dawson
The pagination component. For instruction on use see: http://bakery.cakephp.org/articles/view/65
[Read more]

Simple Tagging Component

By Ben Milleare
This is a quick and easy tagging component that allows you to handle text field, comma-separated input.
[Read more]

Tag Cloud

By tompouce bezehon
Here's a nice way to do a simple and customizable tag cloud.
[Read more]

Sending Email With PHPMailer

By Alex McFadyen
[This is a slightly updated copy of the tutorial on now defunct wiki.cakephp.org]
This example will show you how to send HTML mail from you Cake application with PHPMailer.

You will create:

1. cakePHP component
2. a vendor package
3. view for plain text email body
4. view for HTML email body
5. a function in your controller to send mail.
[Read more]

othAuth component v0.5.4.5

By Othman ouahbi
the component part of othAuth

changes:
0.5.4.5:
- Fixed a bug that was introduced by lately, missing /
- Fixed a bug ( not really bug but oh well ) preventing othAuth from recovering a session from the cookie data in some situations
0.5.4:
- Fixed a bug in loginAttempts reported by PatDaMilla
- Added support for parameters sent via url in a traditional way, mainly for redirects, thanks to Ritesh.
- Probably some other minor bugs

0.5.3:
- Added compatibility with 1.2 redirections
0.5.2:
- Fixed a bug in getData
- Fixed a bug related to the '/' route
- Added lazy model loading support
- Hmm..maybe something else..eh
0.5.1:
added a minor modification to _passAuthData
[Read more]

obAuth Component Tutorial

By Steve Oliveira
This is a tutorial on how to use obAuth component: http://bakery.cakephp.org/articles/view/130
[Read more]

Greater Control with Webservices Component

By Erik
Achieving better control over the Webservices feature provided by the core of CakePHP.
[Read more]

Basic Fallback Component

By Ludge
This is some basic code showing how to capture a missing action error from a component and call a default action defined in the controller.
[Read more]

obAuth Simple Authentication

By Steve Oliveira
Authenticate your users and secure your controller actions from users belonging to certain groups. Or simply secure your controller actions to let any authenticated user to access it.

How to use: http://bakery.cakephp.org/articles/view/121
Some features:
1. User authentication
2. User groups supported
3. Protect action access with 1 line of code
[Read more]

othAuth 0.5 documentation

By Othman ouahbi
the long awaited documentation of othAuth, this article covers the new version of othAuth 0.5
[Read more]

SwiftMailer Component

By Othman ouahbi
This is a component that does encapsulate but not hide swift mailer.
In addition, it adds some nifty features.
In short, this is just a delicious cake-ish swift Mailer.
[Read more]

Integrate CakePHP with Kcaptcha

By Andrew Stephanoff
Simple way to integrate CakePHP with Kcaptcha.
[Read more]

ConfComponent DB based configuration

By Othman ouahbi
DB based configuration, allows you to set and retrieve values organized into conf categories. Now with caching.
[Read more]

ConfComponent DB based configuration Tutorial

By Othman ouahbi
ConfComponent allows you to store your configuration into the db, set and retrieve values organized into categories very easily.Now with caching.

changelog
=========
0.9.1:
- Added the ability to call the component in beforeFilter().
0.9:
- Added file caching to minimize db hits.
- Added default value for get()
- Changed the way you set and get values to be more cake-ish
- Introducing $getEmpty
- Introducing some options to deal with boolean values stored as 'true' and 'false'.
- Added setCat to set a category of configs at once
- Added setBatch to save a set of categories with their configs at once
[Read more]

Yahoo Geo Coding Component

By Jim Rubenstein
I've been looking around the Bakery, and I noticed that there was at least one Google Geo Coding Component, and no Yahoo equivilants. I can't speak as to what the difference is, but I wrote a Yahoo Geo Coding component, which is very simple to use. All you do is plug it in, and start baking.
[Read more]

Google Geocoder

By Sohaib Muneer
This is a wonderful component that will retrieve the latitude and longitude of any given address.
[Read more]

YACCA Yet Another Cake Component for Auth

By Marco Sbragi
A simple but powerful Cake Auth Component
[Read more]

Zip Component

By Sean Callan
I am currently building a web 2.0 implementation of Bake that allows users to create their entire application in a friendly web environment and than creates a zip on demand. I wrote this component and have been using it in my development and alpha implementations of the application.
[Read more]

Automatic Layout Switcher

By Matt Curry
This component allows you to have two layouts for one site and switches between them automatically based on the domain.
[Read more]

SimplePie CakePHP Component

By Matt Curry
SimplePHP is a PHP class for retrieval and parsing of RSS feeds. This is a wrapper to that class making it easy to use in the CakePHP framwork. Much of this component is taken from the work of Scott Sansoni (http://cakeforge.org/snippet/detail.php?type=snippet&id=53). This is mostly an update so the component works with the lastest version of SimplePie.
[Read more]

SimpleAcl component tutorial

By unigue
This component follows the traditional way of acl only slightly modifying it. In example there's an inheritance feature, which will help tremendously the access controlling because you don't have to specify every action in aros_acos-table.
[Read more]

Tracking navigation history of a user

By Jan Boonen
Many times it can be very useful to track the navigation history of a user. Especially if you want to redirect the user to a page where he came from after some action (e.g. login). With this HistoryComponent, it's extremely easy to handle such actions.
[Read more]

Model loader

By Huy
This component helps you to load your models on the fly ( I mean in your actions, whenever).
[Read more]

Ticket Component - i.e. password reset

By Martin Westin
This is my implementation of a simple Ticket Component. A ticket is a way to store a piece of data that can be retrieved and used once. The typical example of this would be a feature to reset user passwords. You need to open that function to a non-secure session. By using a ticket you limit the danger to a more reasonable level. Read on and I will explain...
[Read more]

A Component to help creating SOAP services

By Charles
A component providing automatic WSDL generation using jool.nl Webservice Helper library, CakePHP caching of generated WSDL, and automatic handling of SOAP calls.
[Read more]

Want to order your SQL

By Jorge Escribens
If you don't like to have your sqls scattered around your code maybe this component is for you
[Read more]

Yahoo weather component

By Arash Hemmat
Yahoo! developer network provides a RSS based API to access weather information for locations all around the world. The component has a method named get_weather($locationCode,$degreeUnit) that retrieves the weather information for the given location code and outputs the data in an easy to use array. Please read "http://developer.yahoo.com/weather/" for more information about the location code and degree unit. I will provide a tutorial as soon as possible.
[Read more]

Attachments

By David Persson
Even though there are already good solutions out there this project tries -as usual- to make things even a bit better and to provide a documented, easy to setup and use, extensible, clean implementation of the functionality described in detail below. Plus: It should work and integrate well into the framework everyone of us loves so much.

Parts of the code is based upon or inspired by `Improved Upload Behavior` by Tane Piper, `ImageHelper` by Jon Bennet, `Attach This!` by Alex McFadyen and `Generic Upload Behavior` by Andy Dawson.
[Read more]

Testing Components with CakePHP 1.2 test suite

By Erik Sternerson
This tutorial discusses how to use the CakePHP test suit to test components. It builds upon the excellent work of Mariano Iglesias found here: http://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1-2-test-suite
[Read more]

Image Resizer / Crop

By Wendy
A handy-dandy resize, crop component to be used in controllers rather than view.
[Read more]

LastRSS CakePHP Component

By Jimmy
LastRSS is a PHP class for retrieval and parsing of RSS feeds. This is a wrapper to that class making it easy to use in the CakePHP framwork. Much of this component is taken from the work of Matt Curry (http://bakery.cakephp.org/articles/view/simplepie-cakephp-component) and Scott Sansoni (http://cakeforge.org/snippet/detail.php?type=snippet&id=53).
[Read more]

Using Security Component and multi Checkboxes

By foxmask
As i did not find the way to do it with the Cake FormHelper i will detail what i did and why.

The helper PcformHelper is usefull when you want to use the Security Component, and need to create an array of checkboxes.
[Read more]

cPanel API component

By Hendrik Daldrup
A simple CakePHP component for cPanel XMLAPI calls ( http://www.cpanel.net/plugins/xmlapi/ ).
Requires cURL support.
[Read more]

reCAPTCHA Component & Helper for CakePHP

By Howard Lince
an easy-to-use component and helper set to use reCAPTCHA on your website.
[Read more]

Equation Generation

By Aidan Lister
A component to convert latex mathematical equations to PNG.

The component provides a subset of cleaned-up, cake-ised code from the LatexRender project.
[Read more]

File Upload Component w/ Automagic - Model optional

By Nick Baker
I've written this FileUpload component which provides a lot of automagic to the file uploading process. The problem with all the other File Uploading helpers is they almost always require some sort of database/model for them, which really should be optional when all you want is an easy way to upload files from your website. FileUpload is a component that takes little to zero configuration, detects when a file is being uploaded, verifies its type is allowed, moves the file to a specified folder (being careful never to overwrite anything), and if there is a Model set and present will automatically create a record of it in your database. I couldn't find a simpler "does-it-all-for-you" component for uploading images/files so I wrote one myself. I hope you find it useful.
[Read more]

Paypal Direct Payment Component Using cURL

By Parris Khachi
Looking for a lightweight, easy to use, Paypal credit card processing script? You have found it! This is for Cake 1.2. All you need is cURL and a Paypal API account! I will be updating it with more features when I get a chance. On my to do list is express checkout, refund by transaction Id, and possibly mass refund by an array of transaction ids.
[Read more]

SOAP services in CakePHP

By Marcel Raaijmakers
This article describes what (I think) is the most effective way of calling controller methods with soap calls. At the end of this tutorial, you can do something like '$mySoapClient->foo()' which maps to ControllerX::foo, and '$mySoapClient->bar()' which maps to ControllerY::bar. Pretty cool right? ;-)
[Read more]

Caching ACL permissions with CachedAclComponent

By Frank de Graaf
When you set up ACL with a bunch of groups with subgroups, you will end up with five or maybe more queries per request. When you have a lot of active users it might fry your database. This is a simple solution to get rid of all those queries.
[Read more]

Updated SwiftMailer(4.xx) component with attachments and plugins

By Gediminas
This version of SwiftMailer component is built under cake conventions and has ability to add attachments, plugins and SMTP under TLS or SSL. Also if you are using utf-8 characters Outlook uses different encoding for subject, so there is a possibility to change encoding for both: subject and message.

In this version message is wrapped like in cake's email component etc. email element is wrapped in the email layout for a content type used. I must mention that SwiftMailer library is under GPL license.

Thanks to Matt Huggins who was first to make this component under SwiftMailer version 3.xx
[Read more]