You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace YOUR_API_KEY with the key you obtained from the last.fm API account page. Same goes for YOUR_API_SECRET. Save and close the file.
Create a Model file
Create a new Model which is using this datasource. This model needs no table in your database. Just create a new file in your app/models folder. For example: lastfm.php
class Lastfm extends AppModel {
var $useDbConfig = 'lastfm';
}
This is all you need to do. Save and close the file.
Create a Controller file
Create a new Controller which is using the model we’ve just created. Create a new file in your app/controllers folder. For example: lastfms_controller.php which would follow the CakePHP conventions since we named the model Lastfm. But everything else works too. Just make sure you can access the Model somehow.
class LastfmController extends AppController {
var $uses = array('Lastfm');
}