Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mozmorris/yahooplacefinder-cakephp-datasource
YahooPlaceFinder datasource for CakePhp 2
https://github.com/mozmorris/yahooplacefinder-cakephp-datasource
Last synced: about 2 months ago
JSON representation
YahooPlaceFinder datasource for CakePhp 2
- Host: GitHub
- URL: https://github.com/mozmorris/yahooplacefinder-cakephp-datasource
- Owner: mozmorris
- Created: 2011-12-14T12:20:09.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2011-12-14T12:24:27.000Z (about 13 years ago)
- Last Synced: 2024-10-16T03:23:10.316Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 85.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# YahooPlaceFinder - CakePhp Yahoo PlaceFinder Datasource
* Author: Moz Morris ([email protected])
* version 1.0
* http://www.earthview.co.uk
* license: MITThe purpose of the YahooPlaceFinder datasource is to provide a familiar CakePhp interface for interacting with the Yahoo PlaceFinder API. Provided as plugin with an example MVC implementation demonstrating a simple search.
# Changelog
* 1.0 Sharing it with the world for the very first time.
# Installation
## Get the code
First clone the repository into a new `app/Plugin/YahooPlaceFinder` directory
git clone git://github.com/MozMorris/YahooPlaceFinder-CakePhp-Datasource.git /path/to/your/app/Plugin/YahooPlaceFinder
## Typical setup1. Load plugin
2. Configure datasource
3. Set as datasourceLoading the plugin (*bootstrap.php*):
/**
* Load YahooPlaceFinder Plugin
*/
CakePlugin::load(array('YahooPlaceFinder));
Datasource configuration (*database.php*)public $yahooPlaceFinder = array(
'datasource' => 'YahooPlaceFinder.YahooPlaceFinderSource',
'appid' => 'ABC123'
);Set as datasource (*YourModel.php*)
public $useDbConfig = 'yahooPlaceFinder';
public $useTable = false;
# UsageTypical usage from controller:
$results = $this->Location->find('all', array(
'conditions' => array(
'location' => $this->request->data['Location']['location'],
'flags' => 'JE',
'gflags' => 'ACR',
)
));There is also an example MVC setup demonstrating a simple search:
app/Plugin/YahooPlaceFinderSource/Controller/LocationsController.php
app/Plugin/YahooPlaceFinderSource/Model/Location.php
app/Plugin/YahooPlaceFinderSource/View/Locations/search.ctp