Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Greg Skerman
Ok so i've gotten as far as instantiating the target controller (i assume
this is the right approach...)

how do I render its output from another controller???



On Mon, Dec 27, 2010 at 9:35 PM, Greg Skerman  wrote:

> I should explain a bit better
>
> What i'm trying to do is allow the administrator of the site to manage the
> URL structure, without having to expose them to the routes file which would
> require programming experience or basic understanding of how the router
> works to operate.
>
> The Admin would decide what sections they want in their site (by creating
> "nodes"), and the nodes would then have resources which could be any
> controller/action combination.
>
>
> so assume you have a gallery controller, with a view action and an integer
> as a parameter for a gallery...the output URL would be /gallaries/view/1 for
> arguments sake.
>
> The site Admin might want the gallery to appear under a "services" node,
> and be named "products"
>
> The admin creates the services node, choses to add content, choses the
> content type of "gallery", uploads their files and what not, then names the
> gallery "products" under the "services" node.
>
> The gallery would then be accessed from /nodes/view/services/products,
> which i would collapse with routes down to /services/products
>
> They could then chose to add an article about the services they offer,
> called "index"
>
> the result would be:
> /services/products ---> calls controller galleries, action view, parameter
> 1
> /services/ > calls controller articles, action view, parameter 1
>
> I know all this can be achieved directly through routes, but i'm trying to
> offer it in a form, in an easy to manage system so you don't need to be a
> routing expert to logically structure you site map.
>
>
>
> On Mon, Dec 27, 2010 at 9:27 PM, Greg Skerman  wrote:
>
>> but $this->redirect will change the URL will it not?
>>
>>
>>
>> On Mon, Dec 27, 2010 at 9:25 PM, Jeremy Burns | Class Outfit <
>> jeremybu...@classoutfit.com> wrote:
>>
>>> You do that with $this->redirect...
>>>
>>>
>>> Jeremy Burns
>>> *Class Outfit*
>>> *
>>> *
>>> jeremybu...@classoutfit.com 
>>> http://www.classoutfit.com
>>>
>>> On 27 Dec 2010, at 11:22, Greg Skerman wrote:
>>>
>>> Not actually after a redirect,
>>>
>>> I'm trying to hand control to another controller (in a simillar way to
>>> what request action does), from within a controller, and then render the
>>> output
>>>
>>>
>>> So
>>>
>>> /nodes/view//
>>>
>>> Looks up the Nodes table, for a resource.
>>> the resource record contains Controller and Action for that resource, and
>>> control is handed to that control/resource
>>>
>>> The URL to the end user looks like /nodes/view/section/resource, but
>>> internally its hitting /pages/display/about for arguments sake.
>>>
>>> Simillar i guess to setAction, but more like a setControllerAndAction if
>>> such a beast ever existed.
>>>
>>>
>>>
>>> On Mon, Dec 27, 2010 at 9:15 PM, Jeremy Burns | Class Outfit <
>>> jeremybu...@classoutfit.com> wrote:
>>>
 Happy to be corrected, but I think browser mechanics mean that
 everything will be lost when you do a redirect. The best solution is to
 store the stuff you want transferred in the session and retrieve it in the
 other action. You can also pass small amounts of data as a parameter.

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com 
 http://www.classoutfit.com

 On 27 Dec 2010, at 10:31, Greg Skerman wrote:

 Anyone got any idea? sorry if this is a completely newb question... Open
 to suggestions if its a downright stupid idea..



 On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman wrote:

> Yeah that will only work inside the same controller, where I am trying
> to hand control from one controller to another.
>
> Anyone?
>
>
> On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:
>
>> The controller class has a setAction() function which *Internally
>> redirects one action to another. Does not perform another HTTP request
>> unlike Controller::redirect()* but it I guess it only works within
>> the same controller ...
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google
 Groups "CakePHP" group.
 To p

Re: Any Test on Test Suite?

2010-12-27 Thread Sam Sherlock
App::import the parts of cake needed by your tests

See
https://github.com/markstory/cakephp_menu_component/blob/master/tests/cases/components/menu.test.php

 - S




On 28 December 2010 04:54, John Maxim  wrote:

> I went through Testing at http://book.cakephp.org/view/1196/Testing
>
> Can we create any kind of test in that suite? Are there limitations to
> what we are able to test ? or what we can't test on the Test Suite?
>
> Let's say I want to test ACL scripts on the Test Suite?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Plugin-DataSources Sample ?

2010-12-27 Thread John Maxim
Solved, thanks, Ryan.

On Dec 28, 12:19 pm, Ryan Schmidt  wrote:
> On Dec 27, 2010, at 21:29, John Maxim wrote:
>
> > On Dec 27, 8:12 pm, euromark wrote:
> >> why dont you look in the many available github reps?
>
> > What are *reps ??
>
> Short for "repositories" -- collections of files.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: A Deeper Insights to Database Config Settings

2010-12-27 Thread John Maxim
>  create separate apps which use separate dbs, not one app where you
>  test everything; check the book re useDbConfig; follow a tutorial
>  demonstrating how to use the test suite. with that your question
>  regarding db config should be resolved.

I think I found it, isn't it this one? Testing 4.7
http://book.cakephp.org/view/1196/Testing

Thanks. Regards,

Maxim J.

On Dec 25, 9:05 pm, John Maxim  wrote:
> >check the book re useDbConfig; follow a tutorial
> > demonstrating how to use the test suite. with that your question
> > regarding db config should be resolved
>
> I just checked on: 3.7.8.1 useDbConfig.
>
> There isn't a tutorial on how to use the test suite.
>
> On Dec 25, 4:32 pm, John Maxim  wrote:
>
> > Hi euromark, thanks I'm going to abstain from judging which is better,
> > but let me do with the more common one first..
>
> > Hope that more veterans could rate this thread so we can know which
> > may be the better way. Anyway, it's good enough to work on one method
> > first.
>
> > On Dec 25, 10:50 am, euromark  wrote:
>
> > > @john
>
> > > its not a hack - not even closely
> > > its a valid and in my opinion very well working strategy which worked
> > > for several years
> > > and several apps which repeatedly need updates and stuff.
>
> > > in the end its sth you need to decide for yourself
> > > it also depends on the way you are deploying your apps.
> > > in my case this is the best approach.
> > > in other cases it might (as the others suggested) be less appropriate.
>
> > > so it was more like a suggestion than a "do it this way - its the only
> > > way" :)
>
> > > as a last word one example for the config and config_private settings
> > > and why this is useful:
> > > you always have a default set of configs in svn.
> > > if you would work with a single config file you might lose the
> > > information like
> > > §config = array('x'=>.., 'y'=>..., 'z'=>...)
> > > or at least you might forget about some keys
>
> > > for example if your PC crashes
> > > or you check out your rep on a different computer
>
> > > if you use a default config with empty values you can simply copy it,
> > > save it as config_private
> > > and you can override the empty strings with the real stuff.
> > > Nothing can be forgotten (and this can easily happen with larger
> > > config files!).
>
> > > Either way: Find your own style here :) I did it the hard way as well
>
> > > On 24 Dez., 17:01, John Maxim  wrote:
>
> > > > Hi AD, Thanks for commenting. It makes it clearer that now your
> > > > suggestion seems to be same as Stephen's. I don't have to fret which
> > > > other methods are better. But thanks too euromark, I'm just not good
> > > > at hacking.
>
> > > > >check the book re useDbConfig; follow a tutorial
> > > > > demonstrating how to use the test suite.
>
> > > > Is the book above the cookbook 1.3 or somewhere else ?
>
> > > > On Dec 24, 9:39 pm, AD7six  wrote:
>
> > > > > On Dec 24, 2:19 pm, euromark  wrote:
>
> > > > > > "but obviously you've already managed to mix your environment's 
> > > > > > data"
> > > > > > that was before I wrote my little addons :)
>
> > > > > > wrong! i do have different salts.
> > > > > > i just use a specific config_private (as explained somewhere in this
> > > > > > article) which
> > > > > > overrides the defaults.
>
> > > > > I do not think it better or easier to have database (all) + config
> > > > > (all) + config_private (install specific) + bootstrap (all)
>
> > > > > instead of database (install specific) + config (install specific) +
> > > > > bootstrap (all)
>
> > > > > I also don't see how your post is really relevant to John Maxim's
> > > > > question.
>
> > > > > in any event - if you're happy keep doing it, but I would bet over
> > > > > time you conclude as I did it's not a good idea/technique.
>
> > > > > John Maxim:
>
> > > > > create sepearte apps which use seperate dbs, not one app where you
> > > > > test everything; check the book re useDbConfig; follow a tutorial
> > > > > demonstrating how to use the test suite. with that your question
> > > > > regarding db config should be resolved.
>
> > > > > hth,
>
> > > > > AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Any Test on Test Suite?

2010-12-27 Thread John Maxim
I went through Testing at http://book.cakephp.org/view/1196/Testing

Can we create any kind of test in that suite? Are there limitations to
what we are able to test ? or what we can't test on the Test Suite?

Let's say I want to test ACL scripts on the Test Suite?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Plugin-DataSources Sample ?

2010-12-27 Thread Ryan Schmidt

On Dec 27, 2010, at 21:29, John Maxim wrote:
> On Dec 27, 8:12 pm, euromark wrote:
>> why dont you look in the many available github reps?
> 
> What are *reps ??

Short for "repositories" -- collections of files.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Plugin-DataSources Sample ?

2010-12-27 Thread John Maxim
Hi euromark, thanks I think the closest to what I'm looking for is
from the 3rd link. I didn't know about the github  available *reps.

What are *reps ??

regards,

Maxim J.

On Dec 27, 8:12 pm, euromark  wrote:
> why dont you look in the many available github reps?
>
> https://github.com/neilcrookes/CakePHP-GData-Pluginhttps://github.com/neilcrookes/CakePHP-Twitter-API-Pluginhttps://github.com/neilcrookes/CakePHP-Yahoo-Geo-Planet-Plugin
>
> and many more
>
> On 27 Dez., 07:26, John Maxim  wrote:
>
> > Hi,
>
> > Thanks Amit, do you know any website which implemented using the
> > datasources ? I don't mean give me the codes, I'm just curious about
> > the front-end, I still don't get it. (not understanding) ..
>
> > On Dec 27, 11:46 am, Amit Badkas  wrote:
>
> > > Hi,
>
> > > The guide shows you a way to build/implement datasources which you can use
> > > for your models. About the interface, it's upto you how you want it.
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Sat, Dec 25, 2010 at 9:54 PM, John Maxim  wrote:
> > > > Following the link below:
>
> > > >http://book.cakephp.org/view/1652/Plugin-DataSources-and-Datasource-D...
>
> > > > Does anyone have any working sample already implemented using the
> > > > above Plugin ?
>
> > > > I read how it connects to Twitter and Facebook. How is the interface
> > > > look like after connecting ?
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers
> > > > with their CakePHP related questions.
>
> > > > 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+unsubscr...@googlegroups.com > > >  om>For more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Owner Check

2010-12-27 Thread Dave Maharaj
For the example edit is a Auth only access function and User hasMany XModel
so there would need to be an $id to pull the correct record so passing the
$id is needed. Unless I am not following what your saying?

Thanks,

Dave 

-Original Message-
From: cricket [mailto:zijn.digi...@gmail.com] 
Sent: Monday, December 27, 2010 10:18 PM
To: cake-php@googlegroups.com
Subject: Re: Owner Check

Don't bother passing the $id at all. Just get it from
$this->Auth->user('id'). And don't 'allow' this method. That way,
there must be an id returned.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-27 Thread John Maxim
Hi Jeremy, Thanks for your link will definitely look into that.

~~Continue my question~~
I was going to ask about using this: http://book.cakephp.org/view/1027/query

There are 2 options if I'm correct based on cookbook 1.3
~~
Rather than using an auto-increment key as the primary key, you may
also use char(36). Cake will then use a unique 36 character uuid
(String::uuid) whenever you save a new record using the Model::save
method.

according to: http://book.cakephp.org/view/903/Model-and-Database-Conventions
~~
What's the advantage of using char(36) ?
~~

On Dec 27, 7:18 pm, Jeremy Burns | Class Outfit
 wrote:
> I would always have a non-inteligent single field as the primary key (id) and 
> then have a multiple field unique index on the other two fields. I'd also 
> index them independently for joins and performance. Your second solution 
> looks closest and it's also the way Cake works. 
> Seehttp://articles.classoutfit.com/2010/02/cakephp-basic-database-table-...
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 27 Dec 2010, at 07:33, John Maxim wrote:
>
> > Hi everyone,
>
> > I'm currently creating a table called "Foods_Ingredients", here is the
> > sql:
>
> > CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> > `food_id` int(11) NOT NULL AUTO_INCREMENT,
> > `ingredient_id` int(11) NOT NULL AUTO_INCREMENT,
> > PRIMARY KEY (`food_id`,`ingredient_id`)
> > ) ENGINE=InnoDB
>
> > --
> > The problem now  is I find this table has to have composite primary
> > key. Cake currently doesn't support composite, I'm not sure what is
> > the workaround for this.
>
> > 1. Do I change to UNIQUE KEY ? I went briefly with the cookbook,
> > finding it hard to understand, can anyone suggest a solution for
> > this ?
>
> > 2. Do I just add a field `id` into it ?--so it becomes the PK? Adding
> > this seems a bit odd.
> > 
> > CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> > `id` int(11) NOT NULL AUTO_INCREMENT,
> > `food_id` int(11) NOT NULL,
> > `ingredient_id` int(11) NOT NULL,
> > PRIMARY KEY (`id`),
> > UNIQUE KEY `food_id_ingredient_id` (`food_id`,`ingredient_id`)
> > ) ENGINE=InnoDB
> > 
>
> > What is the suggested solution for this ? from veterans/experienced
> > Cake users.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Owner Check

2010-12-27 Thread cricket
On Mon, Dec 27, 2010 at 4:54 PM, Dave Maharaj  wrote:
> Is there a better way to check if person requesting a record is the owner?
>
>
>
> I am currently doing this for checking but is there a better cleaner way?
>
>
>
>  EXAMPLE**
>
>
>
> function edit( $id = null) {
>
> //attempt to get the record belonging to Auth->User
>
> //basically just a find->(‘first’ , where user_id => Auth and id => $id )
>
> $record = $this->User->__getUserRecord( $this->Auth->user( 'id' ), $id );
>
>
>
> if ( empty( $record )) {
>
> //no record found see ya later
>
> $this->Session->destroy();
>
> //redirect or whatever
>
> }
>
>
>
> if ( !empty ( $record ) ) {
>
> //record belong to Auth User
>
> $this->set( 'data' , $record );
>
> //do whatever
>
> }
>

Don't bother passing the $id at all. Just get it from
$this->Auth->user('id'). And don't 'allow' this method. That way,
there must be an id returned.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: hasAndBelongsToMany - how to call a table?

2010-12-27 Thread ProtoLD
>From a normalized standpoint, you either have no need of the "reviews"
table and should move the comments field into the "cars_users" table,

OR

If you need the comments, shouldn't they be linked to the individual
id of the "cars_users" table itself?  so cars_users=>id to users for
user comments?

On Dec 27, 12:05 am, InYan  wrote:
> Thank you. All 
> fixed:http://img-fotki.yandex.ru/get/5501/web-odissey.0/0_562bf_ef26078b_orig
> The code in the model is 
> correct(?):http://img-fotki.yandex.ru/get/5406/web-odissey.0/0_562c0_dce1a531_orig
>
> On 26 дек, 22:16, Ryan Schmidt  wrote:
>
> > On Dec 26, 2010, at 11:34, InYan wrote:
>
> > > I am a novice cake. Please help. My problem is drawn in the
> > > picture(http://img-kiev.fotki.yandex.ru/get/4907/web-odissey.0/0_5625e_4d94e1...
> > > ). I do not know how to correctly identify the table in compliance
> > > with the convention of cake.
>
> > I think you can name the table anything you want. "reviews" for example.
>
> > The table you've named "users_cars" should I believe be named "cars_users" 
> > (the table names should be listed in alphabetical order). Though if you 
> > want additional information in this table, as you've indicated, you may 
> > want to name it something different, like "sales" and manage the relation 
> > ships yourself, as you will in the "reviews" table.
>
> > You've misspelled a number of column names ("title", "nickname").

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Best way to set up database tables for shared user access?

2010-12-27 Thread Ben
I am writing an application that will allow two different types of
Users (tenant and manager) to create different linked objects
(properties, leases, and User), which they will be able to share.

Here is an example of how I want it to work:
1. A tenant creates and account and adds his Property and Lease.
2. He adds his landlord (a User, alias as Manager) and links the
Manager to the Property and Lease.
3. Manager signs up and effectively takes over the User account that
tenant created for him earlier.
4. Manager now has the ability to use the Property (created by tenant)
in other Leases (once the tenant lease expires, for example)

My problem isn't with the logic of doing all this, but rather how
should I set up my database tables to avoid creating more headaches
when I'm writing the app?

Right now, I'm thinking of giving the Lease table the following
fields:
tenant_user_id (the tenant's user id, if created by tenant)
manager_user_id (the manager's user id, if created by manager)
tenant_leases_id (a way to link multiple tenants to multiple leases;
the relationship between tenants and leases is HABTM)

Any pitfalls I'm missing?  Does anyone have a better or simpler way?


Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Owner Check

2010-12-27 Thread Dave Maharaj
Is there a better way to check if person requesting a record is the owner?

 

I am currently doing this for checking but is there a better cleaner way?

 

 EXAMPLE**

 

function edit( $id = null) {

//attempt to get the record belonging to Auth->User

//basically just a find->('first' , where user_id => Auth and id => $id )

$record = $this->User->__getUserRecord( $this->Auth->user( 'id' ), $id );

 

if ( empty( $record )) {

//no record found see ya later

$this->Session->destroy();

//redirect or whatever

}



if ( !empty ( $record ) ) {

//record belong to Auth User

$this->set( 'data' , $record );

//do whatever

}

 

Thanks

 

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: File upload

2010-12-27 Thread cricket
On Mon, Dec 27, 2010 at 7:10 AM, Leandro Montero  wrote:
> So...nothing to say??

Well, what have you done to debug the problem? Have you checked the
logs (both Cake's and Apache's)? Have you debugged $this->data? Does
the file upload array exist? If so, what error value is there? What
about your code? Will you post the form here? Did you pass 'type' =>
'file' to $this->Form->create()?

There are many things people could say but we'll likely find the
solution soonest if you fill us in on the situation a bit clearer.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Use .htaccess for specific views?

2010-12-27 Thread Ryan Schmidt

On Dec 27, 2010, at 10:02, Jonas wrote:

> This variable:
> suhosin.post.max_value_length
> 
> is set to 65000 by default in my apache2 server. If I change it to
> 130 everything works.
> 
> I guess it's not a good idea to change the variable for the whole
> site?

I don't see why it would be a bad idea. I'd do it that way.

> Can I use htaccess or something to modify this value only when I
> post to this particular page somehow?

I don't think so.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Use .htaccess for specific views?

2010-12-27 Thread cricket
On Mon, Dec 27, 2010 at 11:02 AM, Jonas  wrote:
> Hello,
>
> I have one form with a lot of data in it (easily 200 people, with
> firstname, surname, date of birth, gender etc) but when I post the
> data, $this->data is cut in half.
>
> This variable:
> suhosin.post.max_value_length
>
> is set to 65000 by default in my apache2 server. If I change it to
> 130 everything works.
>
> I guess it's not a good idea to change the variable for the whole
> site? Can I use htaccess or something to modify this value only when I
> post to this particular page somehow?
>
> Oh, and I am using Cake 1.2 but will move to 1.3 after this is done,
> if it makes any difference?

Why do you have a form with the data for ~200 people? At the least,
that strikes me as a very user-unfriendly interface. Could you instead
add/edit people individually?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Plugin controller not finding model

2010-12-27 Thread cricket
On Mon, Dec 27, 2010 at 7:33 AM, WhyNotSmile  wrote:
> Hi everyone, I'm using a plugin from the bakery, and having trouble
> with it.  I think it was working a few days ago, so it's maybe
> something I've done that's caused the problem.
>
> The problem is that the controller doesn't seem to be finding the
> model functions.  So, I'm getting:
>
> Fatal error: Call to undefined method
> InstantPaymentNotificationsController::isValid() in D:\Work\Clients
> \IAAD\site\app\plugins\paypal_ipn\controllers
> \instant_payment_notifications_controller.php on line 31
>
> when I go to the controller action.
>
> The relevant function is:
>
> function process(){
>   if($this->isValid($_POST)){      // This is line 31
>      $notification = $this->InstantPaymentNotification-
>>buildAssociationsFromIPN($_POST);
>      $this->InstantPaymentNotification->saveAll($notification);
>      $this->__processTransaction($this->InstantPaymentNotification-
>>id);
>   }
>  $this->redirect('/');
> }
>
> The controller (instant_payment_notifications_controller.php) starts:
>
> class InstantPaymentNotificationsController extends
> PaypalIpnAppController {
>
>        var $name = 'InstantPaymentNotifications';
>        var $helpers = array('Html', 'Form', 'Paginator');
>        var $components = array('Auth','Email');
>        var $uses = array('InstantPaymentNotification');
>
>
>
> and the model (instant_payment_notification.php) begins:
>
> class InstantPaymentNotification extends PaypalIpnAppModel {
>    var $name = 'InstantPaymentNotification';
>
>
> and has the function isValid().
>
> When I copy the function into the controller, I can call it ok, so
> it's not the function itself that's the problem.  It looks like the
> controller just isn't finding the model.

You're calling the method as if it's in the controller, not the model.

$this->InstantPaymentNotification->isValid(...)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Logging levels in cake 1.2x

2010-12-27 Thread mikeottinger
Yeah I played around with that setting as well, never changed
anything. All I seem to be able to do is separate logging into
different files based on my log statement, but I can't turn off debug
logging.

Thanks!

On Dec 27, 1:20 am, Vivi Vivi  wrote:
> look at
> define('LOG_ERROR', 2);
>
> On 12/27/10, mikeottinger  wrote:
>
>
>
> > Hi All, playing with logging levels in my cake 1.2.7 app, I notice
> > that even if I set this:
>
> > Configure::write('debug', 0);
>
> > I still get debug statements written to the debug.log. Is there really
> > no way to turn these off? My concern is that for areas of my app where
> > I want to apply a lot of debug logging, I'll be building up debug logs
> > on my production server. Any ideas on how to address this? I
> > understand cake 1.3x applies levels better than 1.2x.
>
> > Thanks!
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.com For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> --
> Vivihttp://photos.vr-3d.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Use .htaccess for specific views?

2010-12-27 Thread Jonas
Hello,

I have one form with a lot of data in it (easily 200 people, with
firstname, surname, date of birth, gender etc) but when I post the
data, $this->data is cut in half.

This variable:
suhosin.post.max_value_length

is set to 65000 by default in my apache2 server. If I change it to
130 everything works.

I guess it's not a good idea to change the variable for the whole
site? Can I use htaccess or something to modify this value only when I
post to this particular page somehow?

Oh, and I am using Cake 1.2 but will move to 1.3 after this is done,
if it makes any difference?

Thank you!

/Jonas

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: recursive call

2010-12-27 Thread Valter
Hi Amit - thanks for the reply.

I've done it but no joy. One way I made it appear in the view form was
to change the parent_id argument for parentUsers but in that case when
I tryed to insert another record the parent_id column gets a null
value. Another information that I should've mentioned is that instead
of using the baked code (showed in the original message) if I use
scafold it works just fine. Any other thoghts?? - thanks again.

On Dec 27, 2:51 am, Amit Badkas  wrote:
> Hi,
>
> The form helper judges the options of a select field according to the
> section of field name before '_id'. For example, it uses $departments if
> field name is 'department_id', so try to set variable name as 'parents'
> instead of 'parentUsers'.
>
> Hope this helps.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
>
>
> On Sun, Dec 26, 2010 at 4:34 AM, Valter  wrote:
> > All,
>
> > I a newbie to cake and need your expert help. I've created a db schema
> > then baked it (used cake naming convention all the way). See below the
> > schema:
>
> > users {id(PK), name, lastname, username, password, email,
> > department_id(FK), parent_id(FK)**}
>
> > **parent_id refers to the users table recursively (a user can
> > supervise another user). When I bake it to create all the CRUD
> > functions It seems to work fine but then when I try to ADD a new user
> > the drop down menu do not populate itself with the data I entered
> > manually in the database.
>
> > Funily enough, when I debug() the parentUsers table generated by cake,
> > it returns the values I was expecting in the dropdown element.
>
> > See the bake generated code below:
>
> > thanks
>
> > ** View*
> >  >   debug($parentUsers);
> >   echo $this->Form->input('name');
> >   echo $this->Form->input('last_name');
> >   echo $this->Form->input('username');
> >   echo $this->Form->input('password');
> >   echo $this->Form->input('email');
> >   echo $this->Form->input('department_id');
> >   echo $this->Form->input('parent_id');
> > ?>
> > 
>
> > ** Controller *
> > .
> >   $departments = $this->User->Department->find('list');
> >   $parentUsers = $this->User->ParentUser->find('list');
> >   $this->set(compact('departments', 'parentUsers'));
> > .
> > .
> > .
> > ** Model *
> > var $belongsTo = array(
> > 'ParentUser' => array(
> >        'className' => 'User',
> >        'foreignKey' => 'parent_id',
> >        'conditions' => '',
> >        'fields' => '',
> >        'order' => ''
> >        )
> > );
>
> > ***
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en- Hide quoted text -
>
> - Show quoted text -

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Happy Holiday yule Cake - CakePHP 2.0-dev released

2010-12-27 Thread Everton Yoshitani
Happy Holidays for all! And thanks for the good work!

Cheers,
Everton Yoshitani

On Mon, Dec 27, 2010 at 5:23 AM, Meroe Meroe  wrote:

> Many thanks!
>
>
> On Sun, Dec 26, 2010 at 9:59 PM, huoxito  wrote:
>
>> great! really hope to get to completely understand how cake works to be
>> able to be a part of that team
>>
>> looking forward to work with 2.0
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Plugin controller not finding model

2010-12-27 Thread WhyNotSmile
Hi everyone, I'm using a plugin from the bakery, and having trouble
with it.  I think it was working a few days ago, so it's maybe
something I've done that's caused the problem.

The problem is that the controller doesn't seem to be finding the
model functions.  So, I'm getting:

Fatal error: Call to undefined method
InstantPaymentNotificationsController::isValid() in D:\Work\Clients
\IAAD\site\app\plugins\paypal_ipn\controllers
\instant_payment_notifications_controller.php on line 31

when I go to the controller action.

The relevant function is:

function process(){
   if($this->isValid($_POST)){  // This is line 31
  $notification = $this->InstantPaymentNotification-
>buildAssociationsFromIPN($_POST);
  $this->InstantPaymentNotification->saveAll($notification);
  $this->__processTransaction($this->InstantPaymentNotification-
>id);
   }
  $this->redirect('/');
}

The controller (instant_payment_notifications_controller.php) starts:

class InstantPaymentNotificationsController extends
PaypalIpnAppController {

var $name = 'InstantPaymentNotifications';
var $helpers = array('Html', 'Form', 'Paginator');
var $components = array('Auth','Email');
var $uses = array('InstantPaymentNotification');



and the model (instant_payment_notification.php) begins:

class InstantPaymentNotification extends PaypalIpnAppModel {
var $name = 'InstantPaymentNotification';


and has the function isValid().

When I copy the function into the controller, I can call it ok, so
it's not the function itself that's the problem.  It looks like the
controller just isn't finding the model.

I've asked on the bakery as well, but no reply as yet - and I'm
guessing that with the holidays, it might be a while.

Does anyone have any thoughts?

Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Plugin-DataSources Sample ?

2010-12-27 Thread euromark
why dont you look in the many available github reps?

https://github.com/neilcrookes/CakePHP-GData-Plugin
https://github.com/neilcrookes/CakePHP-Twitter-API-Plugin
https://github.com/neilcrookes/CakePHP-Yahoo-Geo-Planet-Plugin

and many more




On 27 Dez., 07:26, John Maxim  wrote:
> Hi,
>
> Thanks Amit, do you know any website which implemented using the
> datasources ? I don't mean give me the codes, I'm just curious about
> the front-end, I still don't get it. (not understanding) ..
>
> On Dec 27, 11:46 am, Amit Badkas  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > The guide shows you a way to build/implement datasources which you can use
> > for your models. About the interface, it's upto you how you want it.
>
> > Amit Badkas
>
> > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > On Sat, Dec 25, 2010 at 9:54 PM, John Maxim  wrote:
> > > Following the link below:
>
> > >http://book.cakephp.org/view/1652/Plugin-DataSources-and-Datasource-D...
>
> > > Does anyone have any working sample already implemented using the
> > > above Plugin ?
>
> > > I read how it connects to Twitter and Facebook. How is the interface
> > > look like after connecting ?
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > > with their CakePHP related questions.
>
> > > 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+unsubscr...@googlegroups.com > >  om>For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: File upload

2010-12-27 Thread Leandro Montero
So...nothing to say??

On Dec 24, 12:25 am, Tilen Majerle  wrote:
> ouu...that's other problem then :D
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2010/12/23 Leandro Montero 
>
> > That's exactly what i'm doingbut nothing.
> > I mean, my code worked perfectly but suddenly it has stopped!
> > It seems like all the file uploads were disabled!
>
> > On 23 dic, 21:32, Tilen Majerle  wrote:
> > > just use FormHelper, and files you have are stored in $this->data in
> > > controller after submit
>
> > > VIEW like this
>
> > > {{{
>
> > > print $form->create("YourModelName", array('type' => 'file')); //start
> > form
> > > for uploading
> > > print $form->file('inputname'); //input for file
> > > print $form->submit('upload'); //upload button
> > > print $form->end(); //close it
>
> > > }}}
>
> > > in controller in method use like this
>
> > > {{{
>
> > > $file = $this->data["YourModelName"]["fieldname"];
> > > //now $file stored classical array with index like tmp_name, name, size,
> > > mime, error...and u can work like always :D
>
> > > }}}
>
> > > --
> > > Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> > > 2010/12/23 Leandro Montero 
>
> > > > Hi there, in these days i had exactly the same problem as described
> > > > here
>
> > > >http://groups.google.com/group/cake-php/browse_thread/thread/6fdf4b69.
> > ..
> > > > es
> > > > The thing is that the solution overthere doesn't work in my
> > > > website
> > > > Anyone has some clue? I'm completely desperate about this and my
> > > > client
> > > > really wants to kill me!
>
> > > > Thank you!
> > > > Leandro
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others
> > > > with their CakePHP related questions.
>
> > > > 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+unsubscr...@googlegroups.com
> > >For
> > more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Greg Skerman
I should explain a bit better

What i'm trying to do is allow the administrator of the site to manage the
URL structure, without having to expose them to the routes file which would
require programming experience or basic understanding of how the router
works to operate.

The Admin would decide what sections they want in their site (by creating
"nodes"), and the nodes would then have resources which could be any
controller/action combination.


so assume you have a gallery controller, with a view action and an integer
as a parameter for a gallery...the output URL would be /gallaries/view/1 for
arguments sake.

The site Admin might want the gallery to appear under a "services" node, and
be named "products"

The admin creates the services node, choses to add content, choses the
content type of "gallery", uploads their files and what not, then names the
gallery "products" under the "services" node.

The gallery would then be accessed from /nodes/view/services/products, which
i would collapse with routes down to /services/products

They could then chose to add an article about the services they offer,
called "index"

the result would be:
/services/products ---> calls controller galleries, action view, parameter 1
/services/ > calls controller articles, action view, parameter 1

I know all this can be achieved directly through routes, but i'm trying to
offer it in a form, in an easy to manage system so you don't need to be a
routing expert to logically structure you site map.


On Mon, Dec 27, 2010 at 9:27 PM, Greg Skerman  wrote:

> but $this->redirect will change the URL will it not?
>
>
>
> On Mon, Dec 27, 2010 at 9:25 PM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> You do that with $this->redirect...
>>
>>
>> Jeremy Burns
>> *Class Outfit*
>> *
>> *
>> jeremybu...@classoutfit.com 
>> http://www.classoutfit.com
>>
>> On 27 Dec 2010, at 11:22, Greg Skerman wrote:
>>
>> Not actually after a redirect,
>>
>> I'm trying to hand control to another controller (in a simillar way to
>> what request action does), from within a controller, and then render the
>> output
>>
>>
>> So
>>
>> /nodes/view//
>>
>> Looks up the Nodes table, for a resource.
>> the resource record contains Controller and Action for that resource, and
>> control is handed to that control/resource
>>
>> The URL to the end user looks like /nodes/view/section/resource, but
>> internally its hitting /pages/display/about for arguments sake.
>>
>> Simillar i guess to setAction, but more like a setControllerAndAction if
>> such a beast ever existed.
>>
>>
>>
>> On Mon, Dec 27, 2010 at 9:15 PM, Jeremy Burns | Class Outfit <
>> jeremybu...@classoutfit.com> wrote:
>>
>>> Happy to be corrected, but I think browser mechanics mean that everything
>>> will be lost when you do a redirect. The best solution is to store the stuff
>>> you want transferred in the session and retrieve it in the other action. You
>>> can also pass small amounts of data as a parameter.
>>>
>>> Jeremy Burns
>>> *Class Outfit*
>>> *
>>> *
>>> jeremybu...@classoutfit.com 
>>> http://www.classoutfit.com
>>>
>>> On 27 Dec 2010, at 10:31, Greg Skerman wrote:
>>>
>>> Anyone got any idea? sorry if this is a completely newb question... Open
>>> to suggestions if its a downright stupid idea..
>>>
>>>
>>>
>>> On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman wrote:
>>>
 Yeah that will only work inside the same controller, where I am trying
 to hand control from one controller to another.

 Anyone?


 On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:

> The controller class has a setAction() function which *Internally
> redirects one action to another. Does not perform another HTTP request
> unlike Controller::redirect()* but it I guess it only works within the
> same controller ...
>
> Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>


>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> 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+unsubscr...@googlegroups.com For more options, visit this group
>>> at http://groups.google.com/group/cake-php?hl=en
>>>
>>>
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You rece

Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Greg Skerman
but $this->redirect will change the URL will it not?


On Mon, Dec 27, 2010 at 9:25 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> You do that with $this->redirect...
>
>
> Jeremy Burns
> *Class Outfit*
> *
> *
> jeremybu...@classoutfit.com 
> http://www.classoutfit.com
>
> On 27 Dec 2010, at 11:22, Greg Skerman wrote:
>
> Not actually after a redirect,
>
> I'm trying to hand control to another controller (in a simillar way to what
> request action does), from within a controller, and then render the
> output
>
>
> So
>
> /nodes/view//
>
> Looks up the Nodes table, for a resource.
> the resource record contains Controller and Action for that resource, and
> control is handed to that control/resource
>
> The URL to the end user looks like /nodes/view/section/resource, but
> internally its hitting /pages/display/about for arguments sake.
>
> Simillar i guess to setAction, but more like a setControllerAndAction if
> such a beast ever existed.
>
>
>
> On Mon, Dec 27, 2010 at 9:15 PM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> Happy to be corrected, but I think browser mechanics mean that everything
>> will be lost when you do a redirect. The best solution is to store the stuff
>> you want transferred in the session and retrieve it in the other action. You
>> can also pass small amounts of data as a parameter.
>>
>> Jeremy Burns
>> *Class Outfit*
>> *
>> *
>> jeremybu...@classoutfit.com 
>> http://www.classoutfit.com
>>
>> On 27 Dec 2010, at 10:31, Greg Skerman wrote:
>>
>> Anyone got any idea? sorry if this is a completely newb question... Open
>> to suggestions if its a downright stupid idea..
>>
>>
>>
>> On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman wrote:
>>
>>> Yeah that will only work inside the same controller, where I am trying to
>>> hand control from one controller to another.
>>>
>>> Anyone?
>>>
>>>
>>> On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:
>>>
 The controller class has a setAction() function which *Internally
 redirects one action to another. Does not perform another HTTP request
 unlike Controller::redirect()* but it I guess it only works within the
 same controller ...

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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+unsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

>>>
>>>
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php?hl=en
>>
>>
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/g

Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Jeremy Burns | Class Outfit
You do that with $this->redirect...

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 27 Dec 2010, at 11:22, Greg Skerman wrote:

> Not actually after a redirect,
> 
> I'm trying to hand control to another controller (in a simillar way to what 
> request action does), from within a controller, and then render the output
> 
> 
> So
> 
> /nodes/view//
> 
> Looks up the Nodes table, for a resource.
> the resource record contains Controller and Action for that resource, and 
> control is handed to that control/resource
> 
> The URL to the end user looks like /nodes/view/section/resource, but 
> internally its hitting /pages/display/about for arguments sake.
> 
> Simillar i guess to setAction, but more like a setControllerAndAction if such 
> a beast ever existed.
> 
> 
> 
> On Mon, Dec 27, 2010 at 9:15 PM, Jeremy Burns | Class Outfit 
>  wrote:
> Happy to be corrected, but I think browser mechanics mean that everything 
> will be lost when you do a redirect. The best solution is to store the stuff 
> you want transferred in the session and retrieve it in the other action. You 
> can also pass small amounts of data as a parameter.
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 27 Dec 2010, at 10:31, Greg Skerman wrote:
> 
>> Anyone got any idea? sorry if this is a completely newb question... Open to 
>> suggestions if its a downright stupid idea..
>> 
>> 
>> 
>> On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman  wrote:
>> Yeah that will only work inside the same controller, where I am trying to 
>> hand control from one controller to another.
>> 
>> Anyone?
>> 
>> 
>> On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:
>> The controller class has a setAction() function which Internally redirects 
>> one action to another. Does not perform another HTTP request unlike 
>> Controller::redirect() but it I guess it only works within the same 
>> controller ...
>> 
>> Check out the new CakePHP Questions site http://cakeqs.org and help others 
>> with their CakePHP related questions.
>>  
>> 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+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php?hl=en
>> 
>> 
>> 
>> Check out the new CakePHP Questions site http://cakeqs.org and help others 
>> with their CakePHP related questions.
>>  
>> 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+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php?hl=en
> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Greg Skerman
Not actually after a redirect,

I'm trying to hand control to another controller (in a simillar way to what
request action does), from within a controller, and then render the
output


So

/nodes/view//

Looks up the Nodes table, for a resource.
the resource record contains Controller and Action for that resource, and
control is handed to that control/resource

The URL to the end user looks like /nodes/view/section/resource, but
internally its hitting /pages/display/about for arguments sake.

Simillar i guess to setAction, but more like a setControllerAndAction if
such a beast ever existed.



On Mon, Dec 27, 2010 at 9:15 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> Happy to be corrected, but I think browser mechanics mean that everything
> will be lost when you do a redirect. The best solution is to store the stuff
> you want transferred in the session and retrieve it in the other action. You
> can also pass small amounts of data as a parameter.
>
> Jeremy Burns
> *Class Outfit*
> *
> *
> jeremybu...@classoutfit.com 
> http://www.classoutfit.com
>
> On 27 Dec 2010, at 10:31, Greg Skerman wrote:
>
> Anyone got any idea? sorry if this is a completely newb question... Open to
> suggestions if its a downright stupid idea..
>
>
>
> On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman  wrote:
>
>> Yeah that will only work inside the same controller, where I am trying to
>> hand control from one controller to another.
>>
>> Anyone?
>>
>>
>> On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:
>>
>>> The controller class has a setAction() function which *Internally
>>> redirects one action to another. Does not perform another HTTP request
>>> unlike Controller::redirect()* but it I guess it only works within the
>>> same controller ...
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> 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+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-27 Thread Jeremy Burns | Class Outfit
I would always have a non-inteligent single field as the primary key (id) and 
then have a multiple field unique index on the other two fields. I'd also index 
them independently for joins and performance. Your second solution looks 
closest and it's also the way Cake works. See 
http://articles.classoutfit.com/2010/02/cakephp-basic-database-table-tuning-tips/

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 27 Dec 2010, at 07:33, John Maxim wrote:

> Hi everyone,
> 
> I'm currently creating a table called "Foods_Ingredients", here is the
> sql:
> 
> CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> `food_id` int(11) NOT NULL AUTO_INCREMENT,
> `ingredient_id` int(11) NOT NULL AUTO_INCREMENT,
> PRIMARY KEY (`food_id`,`ingredient_id`)
> ) ENGINE=InnoDB
> 
> --
> The problem now  is I find this table has to have composite primary
> key. Cake currently doesn't support composite, I'm not sure what is
> the workaround for this.
> 
> 1. Do I change to UNIQUE KEY ? I went briefly with the cookbook,
> finding it hard to understand, can anyone suggest a solution for
> this ?
> 
> 2. Do I just add a field `id` into it ?--so it becomes the PK? Adding
> this seems a bit odd.
> 
> CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> `id` int(11) NOT NULL AUTO_INCREMENT,
> `food_id` int(11) NOT NULL,
> `ingredient_id` int(11) NOT NULL,
> PRIMARY KEY (`id`),
> UNIQUE KEY `food_id_ingredient_id` (`food_id`,`ingredient_id`)
> ) ENGINE=InnoDB
> 
> 
> What is the suggested solution for this ? from veterans/experienced
> Cake users.
> 
> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Jeremy Burns | Class Outfit
Happy to be corrected, but I think browser mechanics mean that everything will 
be lost when you do a redirect. The best solution is to store the stuff you 
want transferred in the session and retrieve it in the other action. You can 
also pass small amounts of data as a parameter.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 27 Dec 2010, at 10:31, Greg Skerman wrote:

> Anyone got any idea? sorry if this is a completely newb question... Open to 
> suggestions if its a downright stupid idea..
> 
> 
> 
> On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman  wrote:
> Yeah that will only work inside the same controller, where I am trying to 
> hand control from one controller to another.
> 
> Anyone?
> 
> 
> On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:
> The controller class has a setAction() function which Internally redirects 
> one action to another. Does not perform another HTTP request unlike 
> Controller::redirect() but it I guess it only works within the same 
> controller ...
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Handing control over to another controller without redirect or requestAction.

2010-12-27 Thread Greg Skerman
Anyone got any idea? sorry if this is a completely newb question... Open to
suggestions if its a downright stupid idea..



On Mon, Dec 27, 2010 at 12:17 PM, Greg Skerman  wrote:

> Yeah that will only work inside the same controller, where I am trying to
> hand control from one controller to another.
>
> Anyone?
>
>
> On Mon, Dec 27, 2010 at 5:48 AM, huoxito  wrote:
>
>> The controller class has a setAction() function which *Internally
>> redirects one action to another. Does not perform another HTTP request
>> unlike Controller::redirect()* but it I guess it only works within the
>> same controller ...
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Logging levels in cake 1.2x

2010-12-27 Thread Vivi Vivi
look at
define('LOG_ERROR', 2);

On 12/27/10, mikeottinger  wrote:
> Hi All, playing with logging levels in my cake 1.2.7 app, I notice
> that even if I set this:
>
> Configure::write('debug', 0);
>
> I still get debug statements written to the debug.log. Is there really
> no way to turn these off? My concern is that for areas of my app where
> I want to apply a lot of debug logging, I'll be building up debug logs
> on my production server. Any ideas on how to address this? I
> understand cake 1.3x applies levels better than 1.2x.
>
> Thanks!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>


-- 
Vivi
http://photos.vr-3d.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en