Depcrecation

2007-12-08 Thread beetlecube

Was wondering if there is any documentation on the main site, that
tells you when those particular functions listed as deprecated in the
API, will actually be removed from the framework.

I'm using some depcrecated functions now, because when I tried to
upgrade to a higher version of 1.2 to use the form->checkbox, I ended
up with just all blank pages on the entire site, and so I reverted to
my back up of the "cake" directory (which I'm glad I backed up.)

For the time being, I'm going to just hold off on upgrading for a
while but was curious about the older functions.

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need to be corrected on my idea of hasOne

2007-09-23 Thread beetlecube

I'm not sure you are interpreting it correctly, the way the
associations should work.

Anyway, here is how I ended up coding it, as the result of Grant's
reply, and it does works.

In my model, post.php:

  var $belongsTo =array('User' =>
  array('className'  => 'User',
'conditions' => '',
  'order'  => '')
 );


In my model, user.php

 var $hasMany = array('Post' =>
 array('className' => 'Post',
   'conditions'=> '',
   'order' => 'Post.Id DESC',
   'limit' => '',
   'foreignKey'=> 'user_id',
   'dependent' => false,
   'exclusive' => false,
   'finderQuery'   => ''
 )
  );
-

The way my tables work :

 In my Post table,
  I have a "user_id" field. -- Each post can only have at the most
one single user associated with it. --

   But I can't use hasOne, because I'm not linking the user table with
the Post's primary key.

  I'm simply taking some field in my posts table, user_id, and
linking another table to it.


  My User table:

--   Each user can possibly have many posts.   --

   In this case, there is a direct link between
   "users" table and "posts" table,
  and this is the user_id field.

So above I can specify a foreign_key, and this is user_id.



Hope this clears some things up and didn't confuse you.







On Sep 23, 4:49 pm, uoL <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a similar problem, I have a table
>
> Ads
>
> and a table
>
> Models
>
> The logic says an Ad has one Model and a Model belongs lo many Ads
>
> but when I put that logic in the model Ad I get a Unknown column
> 'Model.model_id'. but as beetlecube said is the table Ad which have
> the foreign key
> In this case HasMany asociation is not the case i think.
> do cake need to have tables linked that way or something ?
>
> Thanks!
>
> On 6 sep, 00:02, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > Okay, thanks Grant.
>
> > On Sep 4, 10:36 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > > You want Post belongsTo User,  User hasMany Post.
>
> > > On Sep 5, 3:25 pm, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > > > Hi, hope someone can clear this simple thing up.
>
> > > > I have a Post model (posts table)
> > > > -
> > > >  Pri Key:  int ID
> > > >   varchar[100] comment
> > > >   int User_id  ( the user who posted it of course )
>
> > > > and a User model (users table)
> > > > -
> > > > Pri Keyint ID
>
> > > >   varchar username .. other fields, too...
>
> > > > On my Posts view thtml page, I need for my findAll (run from posts
> > > > controller of course) to get all of my Posts plus the User table
> > > > record that belongs to that post.
>
> > > > But if I have a $hasOne in the Post model, the query attempts to join
> > > > the Post.ID field with User.user_id which doesn't work of course.
>
> > > > But User table doesn't have any fields relating to posts at all.  I
> > > > simply have a user_id in the posts table so that I know who posted
> > > > what.
>
> > > > Do I need to just use the Execute api call from the Model class to
> > > > manually run this query?
>
> > > > It looks like cakePHP is needing for the Post.ID field specifically to
> > > > link up to a foreign id in User.
>
> > > > Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



2 newbie requireAuth questions

2007-09-23 Thread beetlecube

I'm reading in the manual that when using requireAuth, upon cakephp's
entrance into your controller action, the Secur component checks that
the auth key submitted through the POST, and the key that was placed
in a Session array element,  are the same key.

So of course I don't have to manually compare these two myself, with a
"==". ?



My other question is about this statement in the Manual:

 "Next, it sets the key in your controller, to be referenced
later."

  Is this in $this->params ?  I guess I should I test myself by doing
a print_r.  But figured I'd slip this in there.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Posting a form with a regular link

2007-09-22 Thread beetlecube

Thanks for those ideas, once again.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Posting a form with a regular link

2007-09-21 Thread beetlecube

HI All, I have this list of discussion posts that is accessed simply
by going to index.php under /posts/.

And currently, under each post I have a delete link ( of course it
only shows up if you're the user logged in, who also created those
posts, but that's an aside.).

It's just a regular text url link like: /index.php/posts/delete/


But now I decided I'm going to use the cakephp Security component, and
will now need to POST this form to the delete() action.

But the problem is that with a regular text link, you have to use
javascript.

The url will now need to be javascript:submitdelete();  which sets a
hidden form variable to the particular postid, and then calls
form.submit().

I'm wondering how many users have javascript disabled.

And wondering if anyone else went from having to go from get to post
and how you handled it .

TIA
Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Discovered My Very Unsecure Urls

2007-09-17 Thread beetlecube

Thanks for the replies, very helpful.

On Sep 17, 1:31 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Sep 17, 6:45 am, beetlecube <[EMAIL PROTECTED]> wrote:
>
>
>
> > I realized humorously, that my delete links for the posts on my mini-
> > discussion board were clearly showing in the status bar:
> > "www.mysite.com/index.php/posts/delete/45".
>
> > So of course even though the delete link only shows up only for posts
> > where post.userid = session[userid], if you are a user who has half a
> > brain, you would eventually see the URL on the status bar and you
> > could just type it in manually to delete any post you want that other
> > people posted.
>
> > So along with setting the status="" attribute for each "href",   I
> > realized I need to add to my controller's code for the delete()
> > function:
>
> > If  ( $session->read('userid') = $data->post[userid] )
>
> > Would you do even more than that, to prevent unwanted post deletions?
>
> The above would prevent another user from directly deleting posts that
> are not their own. But there should be access control of some kind on
> every url (are these urls only accessible to logged in uses? hope so)
> that does something.
>
> You might want to consider the fact that with nothing else in place a
> malicious user can get bob to delete his own posts just by looking at
> a page with a link of any kind 
> towww.mysite.com/index.php/posts/delete/bobsPostId
> whilst logged in to your site.
>
> More info:http://en.wikipedia.org/wiki/Cross-site_request_forgery(PDF
> referenced is a good read)http://www.ad7six.com/MiBlog/capabilityBasedSecurity
>
> hth,
>
> AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Discovered My Very Unsecure Urls

2007-09-16 Thread beetlecube

I realized humorously, that my delete links for the posts on my mini-
discussion board were clearly showing in the status bar:
"www.mysite.com/index.php/posts/delete/45".

So of course even though the delete link only shows up only for posts
where post.userid = session[userid], if you are a user who has half a
brain, you would eventually see the URL on the status bar and you
could just type it in manually to delete any post you want that other
people posted.

So along with setting the status="" attribute for each "href",   I
realized I need to add to my controller's code for the delete()
function:

If  ( $session->read('userid') = $data->post[userid] )

Would you do even more than that, to prevent unwanted post deletions?


Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need to be corrected on my idea of hasOne

2007-09-05 Thread beetlecube

Okay, thanks Grant.

On Sep 4, 10:36 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> You want Post belongsTo User,  User hasMany Post.
>
> On Sep 5, 3:25 pm, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > Hi, hope someone can clear this simple thing up.
>
> > I have a Post model (posts table)
> > -
> >  Pri Key:  int ID
> >   varchar[100] comment
> >   int User_id  ( the user who posted it of course )
>
> > and a User model (users table)
> > -
> > Pri Keyint ID
>
> >   varchar username .. other fields, too...
>
> > On my Posts view thtml page, I need for my findAll (run from posts
> > controller of course) to get all of my Posts plus the User table
> > record that belongs to that post.
>
> > But if I have a $hasOne in the Post model, the query attempts to join
> > the Post.ID field with User.user_id which doesn't work of course.
>
> > But User table doesn't have any fields relating to posts at all.  I
> > simply have a user_id in the posts table so that I know who posted
> > what.
>
> > Do I need to just use the Execute api call from the Model class to
> > manually run this query?
>
> > It looks like cakePHP is needing for the Post.ID field specifically to
> > link up to a foreign id in User.
>
> > Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Need to be corrected on my idea of hasOne

2007-09-04 Thread beetlecube

Hi, hope someone can clear this simple thing up.

I have a Post model (posts table)
-
 Pri Key:  int ID
  varchar[100] comment
  int User_id  ( the user who posted it of course )


and a User model (users table)
-
Pri Keyint ID

  varchar username .. other fields, too...



On my Posts view thtml page, I need for my findAll (run from posts
controller of course) to get all of my Posts plus the User table
record that belongs to that post.

But if I have a $hasOne in the Post model, the query attempts to join
the Post.ID field with User.user_id which doesn't work of course.

But User table doesn't have any fields relating to posts at all.  I
simply have a user_id in the posts table so that I know who posted
what.

Do I need to just use the Execute api call from the Model class to
manually run this query?

It looks like cakePHP is needing for the Post.ID field specifically to
link up to a foreign id in User.

Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: selectTag confusion

2007-07-22 Thread beetlecube

Oh, very nice. Thanks mucho Geoff

On Jul 22, 9:14 pm, Geoff Ford <[EMAIL PROTECTED]> wrote:
> In 1.2 you should be using 
> Form::selecthttp://api.cakephp.org/1.2/class_form_helper.html#5171e675468c9665db0...
>
> The third param is which items are selected.
>
> Geoff
> --http://lemoncake.wordpress.com
>
> On Jul 23, 1:59 pm, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > I tried searching the board and reading the 1.2 API, but couldn't get
> > this working completely.
>
> > The option drop down does appear, and the values do appear. Very
> > simple one:
>
> > echo $html->selectTag('Post/genre_id', array("0" => "Biography","1" =>
> > "Drama","2" => "Comedy","3" => "Action","4"  => "Sci Fi","5"=>
> > "Horror"));
>
> > And I have this Option control in an "edit post" page, where users
> > edit their comment on a particular book.
>
> > ( The various other fields are Post/title,  Post/body, etc..)
>
> > The Select option control, specifically, is named "Post/genre_id" as
> > you can see in the selectTag statement above.
>
> >   So all I really need is a way to auto-select the value
> > according to the particular Post table record that is being edited.
>
> > I don't think I need generateList(), because I'm just listing a static
> > list of id/labels.  The "Post" table only stores the integer in
> > genre_id.   That's why I'm hard-coding the genre names right into the
> > View file.
>
> > Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



selectTag confusion

2007-07-22 Thread beetlecube

I tried searching the board and reading the 1.2 API, but couldn't get
this working completely.

The option drop down does appear, and the values do appear. Very
simple one:

echo $html->selectTag('Post/genre_id', array("0" => "Biography","1" =>
"Drama","2" => "Comedy","3" => "Action","4"  => "Sci Fi","5"=>
"Horror"));


And I have this Option control in an "edit post" page, where users
edit their comment on a particular book.

( The various other fields are Post/title,  Post/body, etc..)


The Select option control, specifically, is named "Post/genre_id" as
you can see in the selectTag statement above.

  So all I really need is a way to auto-select the value
according to the particular Post table record that is being edited.

I don't think I need generateList(), because I'm just listing a static
list of id/labels.  The "Post" table only stores the integer in
genre_id.   That's why I'm hard-coding the genre names right into the
View file.

Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: About the Blog tutorial

2007-07-18 Thread beetlecube

Great, thanks a lot Geoff
Thanks for the info on your solid blog as well.

On Jul 17, 10:15 pm, Geoff Ford <[EMAIL PROTECTED]> wrote:
> The way I usually do this is i only have an edit function.  If there
> is an $id parameter then I will set $this->data which will fill the
> form, otherwise the form will be empty, thus allowing a new entry
>
> Geoff
> --http://lemoncake.wordpress.com
>
> On Jul 18, 12:58 pm, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > In the official Cakephp blog tutorial,  as we know it obvoiusly takes
> > you through creating a blog,   i.e. a way of adding new posts or
> > editing posts.
>
> > There is an  add.thtml and an edit.thml page.
>
> >  The add.thtml form action link is:  $html->url('/posts/add')
> >  The edit.thtml form action link is:  $html->url('/posts/edit')
>
> >   Besides these two difference, they are both virtually the same file.
>
> > Would it be a good idea to put the Form data into a single element
> > file, and then in edit.thtml and add.thtml, you use
> > renderElement( ,  array("action" => '/posts/add') ,  or of course
> > array("action_url" => '/posts/edit') for the edit view ?
>
> > Then in the element thtml file , it would be $html->url($action_url)
>
> > I realize that the blog tutorial was meant to provide the beginner
> > with the basics and didn't want to introduce elements yet, but figured
> > I'd ask this.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Seems like waste of effort to have both ...

2007-07-18 Thread beetlecube

Ok thanks much guys.

On Jul 18, 6:14 am, MattC <[EMAIL PROTECTED]> wrote:
> I've always just gone with an edit action that does both new and
> edit.  Then I can use the existence/lack of an id to tell them apart.
> So on the view I can do:
>
> if ($this->data['Post']['id']) {
>   echo 'Edit Post';
>
> } else {
>   echo 'New Post';
> }
>
> I prefer this to having two views and an element, since it's only one
> view to manage and one controller action.
>
> If I really wanted /Post/add url I would just add a route and point it
> to the edit action.
>
> -Mattwww.pseudocoder.com
>
> On Jul 17, 12:27 am, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > ... editpost and newpost pages.
>
> > I'm creating a mini-discussion forum, and not sure whether or not to
> > have the "new post" and "edit post" pages just simply combined.
> >  But I don't want the URL bar to say "edit" if someone is creating a
> > new post.  (The other aspects of how to do it this  way are of course
> > easy:  just have a single edit controller to save() without an id,  or
> > save()  with an id)
>
> > Is there an easy to use two controllers, but only have to maintain the
> > code for one single form ?Does anyone use it this way.
> > I'm thinking maybe use the two views (of course, since you have two
> > controllers), but use an element that holds the Form and import this
> > element where you need it?
>
> > Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



About the Blog tutorial

2007-07-17 Thread beetlecube

In the official Cakephp blog tutorial,  as we know it obvoiusly takes
you through creating a blog,   i.e. a way of adding new posts or
editing posts.

There is an  add.thtml and an edit.thml page.

 The add.thtml form action link is:  $html->url('/posts/add')
 The edit.thtml form action link is:  $html->url('/posts/edit')

  Besides these two difference, they are both virtually the same file.

Would it be a good idea to put the Form data into a single element
file, and then in edit.thtml and add.thtml, you use
renderElement( ,  array("action" => '/posts/add') ,  or of course
array("action_url" => '/posts/edit') for the edit view ?

Then in the element thtml file , it would be $html->url($action_url)

I realize that the blog tutorial was meant to provide the beginner
with the basics and didn't want to introduce elements yet, but figured
I'd ask this.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Seems like waste of effort to have both ...

2007-07-17 Thread beetlecube

Yep, that was a mistype. I meant to say, if I had two different
actions with the Post controller (one action for editing a post, and
one for creating a new post), then cake would expect to have two views
with these two actions.   And I'm trying to avoid having to maintain
two different, almost duplicate views (they both show the same exact
form).
But I'll just use render().Thanks.

On Jul 16, 11:30 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Jul 17, 6:27 am, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > ... editpost and newpost pages.
>
> > I'm creating a mini-discussion forum, and not sure whether or not to
> > have the "new post" and "edit post" pages just simply combined.
> >  But I don't want the URL bar to say "edit" if someone is creating a
> > new post.  (The other aspects of how to do it this  way are of course
> > easy:  just have a single edit controller to save() without an id,  or
> > save()  with an id)
>
> Why would you have an edit controller, is that a mis-type? You should
> have an edit method in your Post (for example) controller. You can
> pass render the name of the view file to show, i.e. in your add
> function $this->render('edit');
>
> hth,
>
> AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Seems like waste of effort to have both ...

2007-07-16 Thread beetlecube

... editpost and newpost pages.

I'm creating a mini-discussion forum, and not sure whether or not to
have the "new post" and "edit post" pages just simply combined.
 But I don't want the URL bar to say "edit" if someone is creating a
new post.  (The other aspects of how to do it this  way are of course
easy:  just have a single edit controller to save() without an id,  or
save()  with an id)

Is there an easy to use two controllers, but only have to maintain the
code for one single form ?Does anyone use it this way.
I'm thinking maybe use the two views (of course, since you have two
controllers), but use an element that holds the Form and import this
element where you need it?

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Frustratingly confusion with this very simple thing

2007-06-25 Thread beetlecube

What happened is that the cake blog tutorial has " wrote:
> could also just var_dump($error); instead of running an if statement.
>
> On 6/25/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
>
>
> > First, try a different variable name - I don't think 'error' is
> > predefined but it is possible.
> > Second, try a print_r($this->viewVars) in your view, it will show any
> > of the view variables that have been set by the controller.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Frustratingly confusion with this very simple thing

2007-06-24 Thread beetlecube

Thanks, but getting same thing.

I tried both:

$this->set('error', 0);  and
 $this->set('error', 1);   in case their was reverse logic from what
was intended.

And the IF condition is always seeing that there is an error and
displaying the message.


On Jun 24, 10:01 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> Try using 0 and 1 instead for false and true
>
> T
>
> On 6/25/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > I'm working on my User model ( I'm not using any Auth libraries or
> > anything, just doing it like the CAke blog tutorial did it ).
>
> > And I just
> > 1. Created my register.thtml file for the user.
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Frustratingly confusion with this very simple thing

2007-06-24 Thread beetlecube

I'm working on my User model ( I'm not using any Auth libraries or
anything, just doing it like the CAke blog tutorial did it ).

And I just
 1. Created my register.thtml file for the user.

 2. Then created the register() function in UsersController.


At this point, this function is:

 function register()
{
$this->set('error', false);
}

  And my register.thtml file is simply:


Please correct the following errors


( And a basic form to input username, password, etc.. )


According to the code above, the message:  Please correct the
following errors should *never* appear, correct?

Wel, It's always appearing and that's blowing my mind.

I'm using CAke 1.2.


  Note: -
  As far as the login function goes, for this controller,  I copied
the bulk of the login() function from the Cake blog tutorial, and when
I successfuly log in, I get successfully redirected to another page..
and I don't get any errors essages even though I have the same if/
endif code in that view file.

T.I.A.
Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread beetlecube

Thanks Rajesh and all.

I haven't yet done anything with CakePHP, yet, for clients, so I
figured I'd wonder out loud.

It makes sense to me to simply explain the facts of the matter to a
nontechnical customer
..  and after all, there really is no choice regardless,  when you've
been paid to deliver a quality application. A quality application
should always be based on separation of the entities such as
presentation/logic, etc.. whether it's CakePhp or anything else.

Explaining the benefits clearly,  behind using it, should immediately
cancel out the doubts and make them feel even better about their
choice to hire you.

 So a large part, I'd bet, is even preparing ahead of time, your own
summary explanation of why a framework/CMS should be used. So you can
deliver that explanation to them confidently



On Apr 18, 10:26 am, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Apr 18, 9:55 pm, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > For those who have done PHP development for a client, and used cakePHP
> > to build their sites, a question:
>
> > Have you received complaints from the client, when they have tried to
> > add a page on their own, ? like:
>
> > "This cakephp stuff is complicated, and I just want to add another
> > page that accesses the database, and I didn't know you have to create
> > three different files for it.I can't get a php coder to help me,
> > because they don't know cakephp or MVC"
>
> > Just curious and thought I'd ask
>
>   Some indirect questions received:
> 1. How can I set the site-wide settings?
> 2. How can I edit the pages? Can't I have semi CMS?
> 3. How can the other designer "theme" the site (without CSS)?
>
>   Possible ways to convine the clients:
> 1. Speed. Deliver quick prototypes
> 2. Quite often mention "rails". Every client is crazy of rails these
> days.
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Your client and cakePHP

2007-04-18 Thread beetlecube

For those who have done PHP development for a client, and used cakePHP
to build their sites, a question:

Have you received complaints from the client, when they have tried to
add a page on their own, ? like:

"This cakephp stuff is complicated, and I just want to add another
page that accesses the database, and I didn't know you have to create
three different files for it.I can't get a php coder to help me,
because they don't know cakephp or MVC"

Just curious and thought I'd ask

Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread beetlecube

Thanks for sharing how you do that, Kjell.
That was definitely helpful.

I know I will eventually decide on one of the major frameworks to
adopt permanently.

But sometimes, you're sitting lazily at the PC on a Sunday afternoon,
reading blogs or whatever, and you come across a Javascript function
that you want to add to some permanent library somewhere,  and this
function isn't in whatever Framework I adopted, so I add it to a
central generic utility JS file that grows and grows (and of course
shrinks sometimes when I realize I've added junk to it as well.).

What prompted my post originally is when I ran into this page:
http://www.dustindiaz.com/top-ten-javascript/.  Even though it's over
a year old, there's a couple of handy things in there, so keeping
organized  allows one to, on the fly, add something useful that one
runs into on a website.


On Apr 6, 1:46 pm, "Kjell Bublitz" <[EMAIL PROTECTED]> wrote:
> I put framework related files into one directory under /js/
> Like jquery + all the plugins i use.
>
> I name the folder usually after the frameworks name: yui, prototype, etc..
>
> /js/jquery/jquery.core.js
> /js/jquery/jquery.cookie.js
> /js/jquery/jquery.tooltips.js
>
> So the top folder is usually empty, but i put there my .htacces for
> handling all JS requests  and redirect them to my php script for gzip
> compression and cache settings.
>
> There is only one javascript file on the app/webroot/js/ root,
> and thats the one with my custom code.
>
> It is usually named after the projectname.
>
> /js/.htaccess
> /js/compression.php
> /js/myproject.js
> /js/prototype/prototoype_version.js
> /js/prototype/event-selectors.js
> /js/prototype/datepicker.js
>
> For your described case of using js-files outside: I never work this
> way. I put everything there that i need for the app. If i need it
> outside, i just copy it.
>
> The other way around is: If there is a vendor-app that i include and
> it has own javascript files i move them to the cake app/webroot/js
> directory for consitency. But i never had it that way either.
>
> Lets say i have javascript functions that i only need on the profile
> action of my users controller i simply extend the filename like so:
>
> /js/myproject-userprofile.js
> /js/myproject-eventcalendar.js
> etc..
>
> For me, this is perfect to manage.
>
> On 4/6/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I know that many Cakephpers  use frameworks/libraries like  Prototype
> > and JQuery.
>
> >  What about if you come across some general purpose Javascript
> > functoin and you add those to a "common.js" file that you keep
> > accumulating to ?
>
> > And I'm talking about a common.js type file that you might use even
> > *outside* of your CakePHP websites.
>
> > If you keep this general purpose common.js file inside you app/js
> > directory, but you also use *elsewhere*, then pretty soon they become
> > un-Synchronized, like if you forget to make a copy of one to the other
> > location after making changes to only one of them.
>
> > I think it's a common challenge some of us face -- or not.
>
> > Wondering what you guys do.
>
> > Steve
>
> --
> Regards, Kjellwww.m3nt0r.de


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Organizing, Keeping straight, your Javascript collection

2007-04-06 Thread beetlecube

I know that many Cakephpers  use frameworks/libraries like  Prototype
and JQuery.

 What about if you come across some general purpose Javascript
functoin and you add those to a "common.js" file that you keep
accumulating to ?

And I'm talking about a common.js type file that you might use even
*outside* of your CakePHP websites.

If you keep this general purpose common.js file inside you app/js
directory, but you also use *elsewhere*, then pretty soon they become
un-Synchronized, like if you forget to make a copy of one to the other
location after making changes to only one of them.

I think it's a common challenge some of us face -- or not.

Wondering what you guys do.

Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: content_for_layout

2007-03-22 Thread beetlecube

Funky Comedina, ... this works beautifully

On Mar 22, 9:43 am, "beetlecube" <[EMAIL PROTECTED]> wrote:
> Thanks both of you, appreciate your help!  I saw mention of Elements,
> but I thought it was related html elements. Understood now.
>
> On Mar 22, 9:32 am, "BlenderStyle" <[EMAIL PROTECTED]> wrote:
>
> > Yes, elements are the way to go with this. Think of elements as pieces
> > you can use in your views. If memory serves me correctly, all the
> > variables in the view should be available in your element as well. So,
> > if you have a controller action that uses $this->set('variable', 'some
> > information'), $variable will be available in your view and in your
> > element.
>
> > On Mar 22, 7:40 am, "djiize" <[EMAIL PROTECTED]> wrote:
>
> > > I think you're lokking for 
> > > "elements"http://manual.cakephp.org/chapter/views
> > > in section 1, subchapter Elements
>
> > > On 22 mar, 15:12, "beetlecube" <[EMAIL PROTECTED]> wrote:
>
> > > > HI, I'm using cake v1.2
>
> > > >   My question relates to content_for_layout (I think), and for the
> > > > past hour I've been reading the results of a group search for this
> > > > search term, but couldn't find an answer.
>
> > > >  My views are more or less PHP code that iterates through the results
> > > > of an amazon product lookup.  And really, the code is the same, except
> > > > for the very small that changes from view to view... and that is the
> > > > amazon searchindex such as 'books', 'dvd', etc..
>
> > > > So I took out the generic php look-up and "looping" code and put that
> > > > it in a file called generic.php.  (I don't know where to put that).
> > > > And now, each of my views is stripped down to just:
>
> > > > == books/index.thtml==
> > > > $searchindex = 'Books'
> > > > $display_string = "best selling books";
>
> > > > ==dvds/index.thtml==
> > > > $searchindex = 'dvds'
> > > > $display_string = "best selling DVD's";
>
> > > > However, I have no clue on how to get that generic.php "included".
>
> > > > I tried the obvious thing, i.e., in each view, just put "include
> > > > 'generic.php', below the top two php assignments  but of course I
> > > > didn't expect that to work, because of the way that cakephp is built
> > > > -- it makes you use its own keywords.
>
> > > > Is there an easy way of doing this. Should I be editing the layout/
> > > > default.thml file?
>
> > > > Thanks for reading this,
> > > > Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: content_for_layout

2007-03-22 Thread beetlecube

Thanks both of you, appreciate your help!  I saw mention of Elements,
but I thought it was related html elements. Understood now.

On Mar 22, 9:32 am, "BlenderStyle" <[EMAIL PROTECTED]> wrote:
> Yes, elements are the way to go with this. Think of elements as pieces
> you can use in your views. If memory serves me correctly, all the
> variables in the view should be available in your element as well. So,
> if you have a controller action that uses $this->set('variable', 'some
> information'), $variable will be available in your view and in your
> element.
>
> On Mar 22, 7:40 am, "djiize" <[EMAIL PROTECTED]> wrote:
>
> > I think you're lokking for "elements"http://manual.cakephp.org/chapter/views
> > in section 1, subchapter Elements
>
> > On 22 mar, 15:12, "beetlecube" <[EMAIL PROTECTED]> wrote:
>
> > > HI, I'm using cake v1.2
>
> > >   My question relates to content_for_layout (I think), and for the
> > > past hour I've been reading the results of a group search for this
> > > search term, but couldn't find an answer.
>
> > >  My views are more or less PHP code that iterates through the results
> > > of an amazon product lookup.  And really, the code is the same, except
> > > for the very small that changes from view to view... and that is the
> > > amazon searchindex such as 'books', 'dvd', etc..
>
> > > So I took out the generic php look-up and "looping" code and put that
> > > it in a file called generic.php.  (I don't know where to put that).
> > > And now, each of my views is stripped down to just:
>
> > > == books/index.thtml==
> > > $searchindex = 'Books'
> > > $display_string = "best selling books";
>
> > > ==dvds/index.thtml==
> > > $searchindex = 'dvds'
> > > $display_string = "best selling DVD's";
>
> > > However, I have no clue on how to get that generic.php "included".
>
> > > I tried the obvious thing, i.e., in each view, just put "include
> > > 'generic.php', below the top two php assignments  but of course I
> > > didn't expect that to work, because of the way that cakephp is built
> > > -- it makes you use its own keywords.
>
> > > Is there an easy way of doing this. Should I be editing the layout/
> > > default.thml file?
>
> > > Thanks for reading this,
> > > Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



content_for_layout

2007-03-22 Thread beetlecube

HI, I'm using cake v1.2

  My question relates to content_for_layout (I think), and for the
past hour I've been reading the results of a group search for this
search term, but couldn't find an answer.

 My views are more or less PHP code that iterates through the results
of an amazon product lookup.  And really, the code is the same, except
for the very small that changes from view to view... and that is the
amazon searchindex such as 'books', 'dvd', etc..

So I took out the generic php look-up and "looping" code and put that
it in a file called generic.php.  (I don't know where to put that).
And now, each of my views is stripped down to just:

== books/index.thtml==
$searchindex = 'Books'
$display_string = "best selling books";

==dvds/index.thtml==
$searchindex = 'dvds'
$display_string = "best selling DVD's";


However, I have no clue on how to get that generic.php "included".

I tried the obvious thing, i.e., in each view, just put "include
'generic.php', below the top two php assignments  but of course I
didn't expect that to work, because of the way that cakephp is built
-- it makes you use its own keywords.

Is there an easy way of doing this. Should I be editing the layout/
default.thml file?

Thanks for reading this,
Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ready to upload cakePHp files to my Hostgator account.

2007-01-27 Thread beetlecube

Thanks for your guys'   help.  Very helpful.

I'm trying to make this as simple as possible, so for now, I think 
I'll go with Tarique's advice.   As far as the mod_rewrite,  Hostgator 
support told me that "I can create a mod_rewrite in .htaccess".
Didn't know I could.

Very new to Apache configuration.  In a way, cakePHP presents an 
opportunity for me to have to learn more about Apache, so I ordered a 
book on mod_rewrite in the meantime.

Then when I have learned CakePHP well and completed the actual Web 
App, I wil then take another look at how much more secure I could make 
it by redoing the folder structure and playing with the cakePHP 
constants per DJ Spark's advice.

Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ready to upload cakePHp files to my Hostgator account.

2007-01-26 Thread beetlecube

HI,
  I have a question about folder organization of a CakePHp
installation.

  I'm about to upload my cakephp files to my Hostgator "baby croc"
Shared server space.

 In the CAkePHP manual, the suggested folder structure is:

../path_to_cake_install
/app
/controllers
/models
/webroot <-- Should be DocumentRoot
.htaccess
index.php

Should I send a Support Email to Hostgator that I need to have the
httpd.conf changed for rmy account, so that my webroot is
"Mydomain.com/app/webroot"  ?

I really have no particular way that I prefer the folder organization
to be.

I just want it to work, basically,  and preferably with the mod_rewrite
enabled, so that I don't have to stick that "index.php" in the middle
of everything.But if I do have to use the "index.php" inside the
URL,  no big deal even.

( if anyone has a method by which I need to rely on H.G. support as
little as possible, please let me know. )

Thanks, Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---