class TweetsController extends AppController {
var $name = 'Tweets';
var $helpers = array('Html', 'Form');
function index(){
$this->Twitter = ConnectionManager::getDataSource('twitter');
//$response = $this->Twitter->account_verify_credentials();
$search_results = $this->Twitter->search('cakephp');
ToProcess::writecfg('xpto');
}
}
I tried to call the method in this model
<?php
class ToProcess extends AppModel {
var $name = 'ToProcess';
//write configuration data back to the DB
function writecfg($value){
$this->data = array('key'=>'key','value'=>$value);
$this->save($this->data);
}
}
?>
The problem here is that i dont understand the logic behind, so i hope
this code helps in any way, other than introducing more noise.
Basically i want to register some data in one table, from the first
model. To do that, i've tried to create the model Setting
Hope you guys can help. If there is any example that can help on the
web, letme know.
On Apr 27, 5:08 pm, brian <bally.z...@gmail.com> wrote:
> On Sun, Apr 26, 2009 at 5:25 PM, AGD <anibaldam...@gmail.com> wrote:
>
> > Hi all
>
> > I would like some help from you since i am recently starting to tast
> > the cake.
>
> > I am trying to create one page where there is an call to an API, and
> > would like to store the result of that call for later processing into
> > the DB.
>
> > I've created one test page. In that page's controller i would like to
> > save data into a table in the database.
>
> > Should i create a model and controller for that table? IF so, how can
> > i do it and then call it actions from the previous controller?
>
> > An existing example or blog post would be appreciated
>
> Likewise, it'd be better if you gave a concrete example of what you
> want to do. Are the 2 models associated with each other?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment