Re: some newbie questions

2009-09-19 Thread lorenx
that's exactly what i wanted to know, thank you. On Sep 19, 6:35 pm, Hols Kay wrote: > Yes - because it's coming from the URL it's not *strictly* necessary > to redefine it in your controller, but defining it in the controller > is generally better coding style because the explicit relationshi

Re: some newbie questions

2009-09-19 Thread Hols Kay
Yes - because it's coming from the URL it's not *strictly* necessary to redefine it in your controller, but defining it in the controller is generally better coding style because the explicit relationship is easier to see at-a-glance. It also means that you're better able to do checks on the id nu

Re: some newbie questions

2009-09-19 Thread lorenx
> 1. Cake's reading the id from the url. You're saying, in the url, > 'show me the Post controller / the View method / and record number > #n', and Cake's handling that for you automatically. sure but... what if i comment out all the $id reference? this cleaned code: function view() { $th

Re: some newbie questions

2009-09-19 Thread Hols Kay
1. Cake's reading the id from the url. You're saying, in the url, 'show me the Post controller / the View method / and record number #n', and Cake's handling that for you automatically. 2. Post/Somefunction only becomes a valid URL if you make a corresponding view file for it. You can, if you wan

Re: some newbie questions

2009-09-19 Thread lorenx
thanks to all! ...but i still have some doubts. 1. if i write: function view() { $this->set('post', $this->Post->read()); } then the urls post/view/1 and post/view/2 continue to show respectively post n.1 and post n.2, i cannot understand how (maybe i have to look depper in the code) 2.

Re: some newbie questions

2009-09-18 Thread Hols Kay
1. $this->Post->id = $id sets the model id field to whatever the id is that you've passed in the URL. That's retained for the $this->Post- >read(); underneath it. You can also say things like $this->set ('post', $this->Post->read(null, $id)); to read all the fields for record $id, for example, ins

Re: some newbie questions

2009-09-18 Thread Miles J
1 - The "$this->Post->id = " tells what ID to use for read(). If no ID is passed then it wont find the correct data or it will return the first row in the database. 2 - Every page (or action, e.g., /users/login, login is the page) must be created within the respective controller. 3 - $this->data

Re: some newbie questions

2009-09-18 Thread lorenx
a little help please? On Sep 17, 8:05 pm, lorenx wrote: > hi all, > i'm new to cakephp and, mentioning the blog tutorial, i have some > simple questions. > > 1. > in the sample controller, there is the view action: > > function view($id = null) { >         $this->Post->id = $id; >         $this

Re: some newbie questions

2009-09-18 Thread Simon
nobody helps no body here sometimes you get luck we need a group called cakephp_for_noobs On Sep 18, 11:40 am, lorenx wrote: > a little help please? > > On Sep 17, 8:05 pm, lorenx wrote: > > > > > hi all, > > i'm new to cakephp and, mentioning the blog tutorial, i have some > > simple questions

some newbie questions

2009-09-17 Thread lorenx
hi all, i'm new to cakephp and, mentioning the blog tutorial, i have some simple questions. 1. in the sample controller, there is the view action: function view($id = null) { $this->Post->id = $id; $this->set('post', $this->Post->read()); } to better understand, i did some tests

Re: Some newbie questions part 1: showing form for a habtm relation

2007-12-03 Thread Adam Royle
work the way you want. Cheers, Adam On Dec 1, 8:36 am, Bram <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm baking my first CakePHP project at the moment and I've some newbie > questions. I'll ask each question in it's own topic. > > First of all, I'v

Some newbie questions part 1: showing form for a habtm relation

2007-11-30 Thread Bram
Hi all, I'm baking my first CakePHP project at the moment and I've some newbie questions. I'll ask each question in it's own topic. First of all, I've a model with an habtm relation, let's call this model Company. The related model is called Specialty. I would like