Re: Cake sheet

2008-08-22 Thread Paolo Stancato

2008/8/23 Samuel DeVore <[EMAIL PROTECTED]>:
>
>
> As far as I know it is, but it is for 1.1 NOT 1.2
>

What I thought anyway, is a good "quick reference".

Cheers!

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake sheet

2008-08-22 Thread Samuel DeVore

On Fri, Aug 22, 2008 at 7:09 PM, Paolo Stancato <[EMAIL PROTECTED]> wrote:
>
> Hi there!
>
> Can anyone tell me if this is the last revision of the Cake sheet?

As far as I know it is, but it is for 1.1 NOT 1.2


>
> http://cakephp.org/files/cakesheet.pdf
>
> Thanks in advance!
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake sheet

2008-08-22 Thread Paolo Stancato

Hi there!

Can anyone tell me if this is the last revision of the Cake sheet?

http://cakephp.org/files/cakesheet.pdf

Thanks in advance!

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake + WAMP

2008-08-22 Thread Arak Tai'Roth

Is anyone able to help me with this issue please?

On Aug 22, 11:14 am, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
> So I decided I would try using WAMP for my development setup. But for
> some reason I go to localhost and get the WAMP homepage fine, yet when
> I try to access my project I get this "The requested URL /app/webroot/
> was not found on this server.".
>
> I did edit the httpd.conf file to load mod_rewrite and I did restart
> the services after doing that.
>
> I am using the newest version of WAMP, freshly downloaded, and using
> the latest build of Cake. My directory structure for this is C:\wamp
> \www\projectname\
>
> Does anyone know if there is anything else I need to do to get this
> working on WAMP?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: To write my database records in Excel

2008-08-22 Thread Wayne Fay

This is a very common query on this list. Please search the archives.

Also check the bakery for code help, especially this article:
http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database

Wayne

On 8/22/08, Fredy <[EMAIL PROTECTED]> wrote:
>
>  In servlets we hav the option of writing into a Excel / word file
> straight away usin
> contentype() method Is there any similair way to write my mysql
> database records into
> Excel sheet using php or else is there some other way ...
>
> I need to Generate Reports from my database ... dynamic reports(Excel
> sheet ) how to do it in php .
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SQL: where column NOT IN ...

2008-08-22 Thread Mariano Iglesias
'not' => array('Model.field' => array( 1, 2, ...))

haj wrote:
> It's just current implementation doesn't take 'NOT' keyword with the
> use of IN() for array, i guess, and yields the same result anyway...
>   

-- 
-MI
CIO @ CRICAVA Technologies 
 
*Blog*: http://www.marianoiglesias.com.ar
*Twitter*:  http://twitter.com/mgiglesias
*LinkedIn*: http://www.linkedin.com/pub/2/483/B94
*Facebook*: http://pl.facebook.com/people/Mariano_Iglesias/646886921


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SQL: where column NOT IN ...

2008-08-22 Thread haj

It's just current implementation doesn't take 'NOT' keyword with the
use of IN() for array, i guess, and yields the same result anyway...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Database table suffix

2008-08-22 Thread Dexter

Just started using CakePHP, and am pretty new to frameworks for PHP in
general.

I am trying to use CakePHP to rewrite a disaster of a company portal
site we currently use.  The database structure is pre-existing, and I
don't want to have to do a database restructure.

For the most part, everything works pretty good, it's just that I was
wondering if it'd be possible to have a table suffix automatically
applied like how the table prefix is.

The way our db structure is set up is like so: dex_users_usr (__)

The company prefix is set up in the database config and is applied to
all tables, and in this case, in order to apply the appropriate
suffix, the suffix would have to be set up in the model for that
specific table.

Is there a good way to go about doing this?  I'd like to be able to
define table specific suffixes via a variable, and have it so Cake
doesn't include the suffix like how it doesn't include the prefix in
the datasets.

Thanks for any ideas.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Database relationships etc

2008-08-22 Thread Rafael Bandeira aka rafaelbandeira3

Oh, I almost slept, you should try to more clear and less verborragic,
so many explanation just messed up things more and more...
And you should do 2 things when you can't speak a language : 1) look
for groups with the same language of yours and 2) say your
nacionality, so members from the same country can get sensible with
you and try to help you more

"stop the bullshit and answer me..."

OK, answers :
> 1) Do I have to manually set up Foreign keys for tables?

it depends, did you sitcked to conventions?
Your CarAd Model has the following scheme and linking convention:

id  - primaryKey
car_type_id- className => CarType, uses table -
> car_types
car_brand_id  - className => CarBrand, uses table -
>  car_brands
car_fuel_id - className => CarFuel, uses table
->  car_fuels
car_transmission_id- className => CarTransmission, uses
table ->  car_transmissions
year
ad_county_id  - className => AdCountry, uses table
->  ad_countries
ad_borough_id- className => AdBorough, uses table -
> ad_boroughs (?)
info
price
car_ad_type_id   - className => CarAdType, uses tabl -
> car_ad_types
added  <- tip : is this field meant to hold the
datetime of row creation? if yes, rename it to "created" and cakePHP
will handle it for you

Said that all this foreign keys says : this CarAd belongs to this
CarType, and to this CarBrand, and to that CarFuel... so you should
have in your model class:

class CarAd extends AppModel {
   var $belongsTo = array (
'CarType', 'CarBrand', 'CarFuel', 'CarType',
'CarTransmission', 'AdCountry', 'AdBorough',
   )
}

now CakePHP will map all your model's foreign keys and you will be
able to access this relateds models as a property of your CarAd
model :
// inside your model
$this->CarType->find([...]);
inside your controller
$this->CarAd->CarType->find([...]);

answered? moving on...

> 2) Do I have to build model for each table I need to get id's
> from..even if the table itself will stay static ? (model for
> car_transmissions, car_fuels_id... tables)


No, actually CakePHP map table names for you too. >>
http://www.littlehart.net/atthekeyboard/2008/08/05/dynamic-models-in-cakephp-12/



>   By static I mean that I don't need to add or delete data from it
> because probably there will not be any new transmission types
> coming. I only need to read info from it.
>
>
> I know 100% that I have to build model for tables which will have
> dynamic content...like table car_brand. (new car brand comes.. for ex.
> "BMW-Jaguar"..and I need to add it to table from site...not manually)

you should avoid this kind of thinking...

> So my main table at this time is car_ads and I have controller for
> it... and it also gives me it's table contents with simple index():
>   function index() {
>   $this->set('carads',$this->CarAd->find('all'));
>   }
>
> But I want to see text in the list..not that number which I have on
> car_transmission_id field. (Instead of number 1 I would like to see
> text: "Automatic")

> Currently line looks like this: Brand: 5  Year: 2000 Transmission: 1
> Gas: 2
> But it should look like this:   Brand: Chevrolet Astro Year: 2000
> Transmission: Automatic  Gas: Benzine

No actually it shouldn't, what is happening is the normal and expected
behavior.

I'll explain what is already in the manual about cakePHP's data
scheme, I'll wont reproduce arrays here because it would be very ugly
and painfull for me so take this as example : 
http://book.cakephp.org/view/448/findall
-> the grey box at the bottom of the content...

that's how your data will return but with the your model names...
back to your CarAdsController::index() :

>   function index() {
>   $this->set('carads',$this->CarAd->find('all'));
>   }

in your view you will have a var named 'carads', and you'll be able to
access data as the array in the link shows :
// first entry's CarTransmission.transmission wil be accessed like
this
echo $carads[0]['CarTransmission']['transmission'];

// the nth entry/row CarBrand.name will be accessed like this
echo $carads[$num]['CarBrand']['name'];

for a dynamic list or table generation, you would do something like
this:
foreach($carads as $entryNum => $entryData)
{
   echo 'Transmission: ' . $entryData['CarTransmission']
['transmission'];
   echo 'Brand : ' . $entryData['CarBrand']['name'];
   echo 'Country :  ' . $entryData['CarCountry']['name'] . '';
}

> I'll try to explain it once more..maybe it helps to clear things out:

   you actually didn't explain anything, just asked more questions ;-)

> 1) I have table car_ads which will hold car ads... to that table will
> be added all kind of info... car brand, car transmission type, fuel
> type.. info, make year. Most things should be choosed from other
> tables...so when I'm inserting a new ad,

Database relationships etc

2008-08-22 Thread fuSEboX

Hi,

First post here and also that text was right "probably this question
has been asked before" etc. :)

I must say that first experiences with Cake are wonderful... seems to
save lots of time. Although, one part is totally confusing for
me...it's the hasOne, hasMany, belongsTo... part. So I decided to ask
for guidlines for my specific database to get the clue. (I've read 1.2
manual and examples on net but still confusing..probably problems with
not understanding everything in English)

Scenario:
I need to CRUD car ads...for that I have table "car_ads" which own
fields: id, car_type_id, car_brand_id, car_fuel_id,
car_transmission_id, year, ad_county_id, ad_borough_id, info, price,
car_ad_type_id, added.

each *_id field presents table... for example car_transmission_id
means id from table car_transmissions.
And table "car_transmissions" looks like this: id, transmission (which
has values like: "Automatic", "Manual")

So my main table at this time is car_ads and I have controller for
it... and it also gives me it's table contents with simple index():
function index() {
$this->set('carads',$this->CarAd->find('all'));
}

But I want to see text in the list..not that number which I have on
car_transmission_id field. (Instead of number 1 I would like to see
text: "Automatic")


So here are the questions:

1) Do I have to manually set up Foreign keys for tables?
2) Do I have to build model for each table I need to get id's
from..even if the table itself will stay static ? (model for
car_transmissions, car_fuels_id... tables)
  By static I mean that I don't need to add or delete data from it
because probably there will not be any new transmission types
coming. I only need to read info from it.


I know 100% that I have to build model for tables which will have
dynamic content...like table car_brand. (new car brand comes.. for ex.
"BMW-Jaguar"..and I need to add it to table from site...not manually)


I'll try to explain it once more..maybe it helps to clear things out:

1) I have table car_ads which will hold car ads... to that table will
be added all kind of info... car brand, car transmission type, fuel
type.. info, make year. Most things should be choosed from other
tables...so when I'm inserting a new ad, I should see dropdown list
for "Car transmission". And when I select from that list "Automatic"
then equaling id will be added to table car_ads into
car_transmission_id field.
2) When I enter the index(), then list of ads will be displayed...but
how to make it show text instead of different id's ?

Currently line looks like this: Brand: 5  Year: 2000 Transmission: 1
Gas: 2
But it should look like this:   Brand: Chevrolet Astro Year: 2000
Transmission: Automatic  Gas: Benzine

I'm able to do MySQL left join for that...it works...but in
CakePHP...it's mystic.

SELECT ca.id, ca.year, ct.transmission, cf.type FROM car_ads ca
LEFT JOIN car_transmissions AS ct ON (ca.car_transmission_id = ct.id)
LEFT JOIN car_fuels AS cf ON (ca.car_fuel_id = cf.id)
WHERE ca.id =1


Big thanks to anyone who helps me getting back on tracks.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SQL: where column NOT IN ...

2008-08-22 Thread starkey

I'm not clear on why the NOT (column IN ()) syntax is required when
NOT IN () is valid SQL (in Oracle and MySQL it works).  Any ideas?

Thanks!


On Aug 22, 12:15 pm, starkey <[EMAIL PROTECTED]> wrote:
> Perfect!  Thanks!
>
> On Aug 21, 5:19 pm, teknoid <[EMAIL PROTECTED]> wrote:
>
> > NOTIN is possible, but your syntax isnotcorrect...
>
> > See the "NOT" array:http://book.cakephp.org/view/74/complex-find-conditions
>
> > On Aug 21, 4:08 pm, starkey <[EMAIL PROTECTED]> wrote:
>
> > > Hello all,
>
> > > I searched for this without success.  I'm using 1.2 RC2 and I need to
> > > run a query like this:
> > > $this->execute('delete from table where columnnotin (1,2,3)');
> > > OR
> > > $this->deleteAll(array('id'=>'NOTIN (1,2,3)'),false, false);
>
> > > The problem is that the execute() returns 'unhandled'.  I traced the
> > > code and obviously nate,gwoo, and the gang are far better coders than
> > > I because I couldn't figure out why I am getting 'unhandled' back.
>
> > > Can someone help me with this, please?
>
> > > Related, I am also wondering if it is possible to do something like
> > > this (although I haven't tried):
> > > $this->find('all',array('conditions'=>array('id'=>'NOTIN (1,2,3)')));
>
> > > Thank you!- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



something like Joomla modules

2008-08-22 Thread luigi7up

Hello everyone.

I just started to explore Cake PHP and already love it.

I'm trying to create a simple CMS. I have few questions about how to
solve some problems that came along development. I was using Joomla
for a few years so I'm used to refer some elements like "pools",
"latest comments", "tags cloud", "menus" etc. as MODULES.

My question is what would be a good approach to build them in Cake
PHP.

For example: should I define a new helper/component that would check
installed and active modules and then call that helper from a view or
template file?

Some guidelines how to approach would be just fine

Hope you understand my question :)

Thank you very much...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination and Containable behavior for indirectly-related Models

2008-08-22 Thread Darwin Bautista

Hi all,

I want to paginate a certain model and include some data from an
indirectly-related model.
To better illustrate, consider the following Model relationships:

Match belongsTo array(
'FirstFamily' => array(
'className' => 'Family',
'foreignKey' => 'first_family_id'
),
'SecondFamily' => array(
'className' => 'Family',
'foreignKey' => 'second_family_id'
),
)

Family hasMany FamilyParent


Now, in my paginated view, I want to show:

Match.id
Family.id
FamilyParent.first_name, FamilyParent.last_name (from FirstFamily)
FamilyParent.first_name, FamilyParent.last_name (from SecondFamily)

Is this even possible? If it is, then will column sorting still work or not?

Thanks in advance.

-- 
~dmb

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Deleting with cascade with custom foreign key

2008-08-22 Thread Mambo

Hi. I'd appreciate some help on this one please...

I'm trying to recursively an item that hasMany other items. The "other
item" model has a custom $foreignKey defined (due to restrictions on
the available database).

However, when deleting an "item", this custom foreign key isn't
recognised, and cake fires out a query of "otheritem.id", as opposed
to "otheritem.customid", and obviously causes an SQL error, as the
field does not exist.

Have I found a bug in Cake, or has anyone else solved this problem?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake + WAMP

2008-08-22 Thread Arak Tai'Roth

So I decided I would try using WAMP for my development setup. But for
some reason I go to localhost and get the WAMP homepage fine, yet when
I try to access my project I get this "The requested URL /app/webroot/
was not found on this server.".

I did edit the httpd.conf file to load mod_rewrite and I did restart
the services after doing that.

I am using the newest version of WAMP, freshly downloaded, and using
the latest build of Cake. My directory structure for this is C:\wamp
\www\projectname\

Does anyone know if there is anything else I need to do to get this
working on WAMP?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SQL: where column NOT IN ...

2008-08-22 Thread starkey

Perfect!  Thanks!

On Aug 21, 5:19 pm, teknoid <[EMAIL PROTECTED]> wrote:
> NOTIN is possible, but your syntax isnotcorrect...
>
> See the "NOT" array:http://book.cakephp.org/view/74/complex-find-conditions
>
> On Aug 21, 4:08 pm, starkey <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello all,
>
> > I searched for this without success.  I'm using 1.2 RC2 and I need to
> > run a query like this:
> > $this->execute('delete from table where columnnotin (1,2,3)');
> > OR
> > $this->deleteAll(array('id'=>'NOTIN (1,2,3)'),false, false);
>
> > The problem is that the execute() returns 'unhandled'.  I traced the
> > code and obviously nate,gwoo, and the gang are far better coders than
> > I because I couldn't figure out why I am getting 'unhandled' back.
>
> > Can someone help me with this, please?
>
> > Related, I am also wondering if it is possible to do something like
> > this (although I haven't tried):
> > $this->find('all',array('conditions'=>array('id'=>'NOTIN (1,2,3)')));
>
> > Thank you!- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using one login function on 2 different controllers

2008-08-22 Thread seanislegend

Ah! Got it working, just realised I had to add the model name in the
input field.

Thanks for your help!

On Aug 22, 4:45 pm, seanislegend <[EMAIL PROTECTED]> wrote:
> I can indeed. It's set to "/cake/users/login".
>
> This is what's posted on the login page when I login via the home
> page:
> Array ( [_method] => POST [data] => Array ( [Home] => Array
> ( [username] => sean [password] => test ) ) )
>
> I presume I need to somehow switch that 'Home' with 'Users'??
>
> Thanks for your help!
>
> On Aug 22, 2:13 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > On Fri, Aug 22, 2008 at 6:37 PM, seanislegend
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Thanks for your suggestion. Sadly, I've already tried that and it
> > > doesn't work!
>
> > Can you elaborate on what does not work? Can you see the action of the
> > form set to users/login when you view the HTML source?
>
> > Tarique
>
> > --
> > =
> > 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 
"CakePHP" 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: Using one login function on 2 different controllers

2008-08-22 Thread seanislegend

I can indeed. It's set to "/cake/users/login".

This is what's posted on the login page when I login via the home
page:
Array ( [_method] => POST [data] => Array ( [Home] => Array
( [username] => sean [password] => test ) ) )

I presume I need to somehow switch that 'Home' with 'Users'??

Thanks for your help!


On Aug 22, 2:13 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 22, 2008 at 6:37 PM, seanislegend
>
> <[EMAIL PROTECTED]> wrote:
>
> > Thanks for your suggestion. Sadly, I've already tried that and it
> > doesn't work!
>
> Can you elaborate on what does not work? Can you see the action of the
> form set to users/login when you view the HTML source?
>
> Tarique
>
> --
> =
> 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 
"CakePHP" 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: cakephp Linux

2008-08-22 Thread draikin

Ecxept for many solutions you could find per google I prefer the
following. Download and install xampp (http://www.apachefriends.org/en/
xampp.html) and then download cakephp an install as described on many
tutorials and manuals.

HTH
draikin

[EMAIL PROTECTED] schrieb:
> Hi, I �m trying to install ang configure cake in linux and I dont now
> how. I have no expierence neither in linux nor cake. I need step by
> step the instructions.
> Thank you very much...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Create links to navigate back to last visited page

2008-08-22 Thread draikin

Hi clemos,

thank you for your solution that I read also. But just like $this-
>referer() doesn't work for all browsers javascript doesn't work for
all users, as there are some users who don't like javascript. But if
there is a need for javascript in cakephp apps anyway (i don't know if
this is so), your solution is the easiest.

draikin


clemos schrieb:
> Maybe I didn't understand your problem, but ...
> Why don't you give a try to my good old plain javascript solution ?
>
> go back
>
> The link above will get you back just like your "back" browser button would...
> You can even go back further with "window.history.go(-10)" (ten pages back)
> No Cake, No PHP, just simple javascript...
>
> $this->referer() doesn't work for all browsers, cause the referer must
> actually be sent by the client (IE doesn't seem to send it all the
> time).
> +++
> Clément
>
> On Thu, Aug 21, 2008 at 7:35 PM, draikin <[EMAIL PROTECTED]> wrote:
> >
> > Thank you for your response. Yes, thats what I'm looking for. But the
> > problem is that $this->referer() seems not to work. So I will test the
> > bread crumb feature from the HTML helper.
> >
> > draikin
> >
> > teknoid schrieb:
> >> You are probably looking for something like $this->referer()
> >>
> >> Also there is a bread crumbs feature in the HTML helper, for something
> >> more robust.
> >>
> >> On Aug 21, 10:35�am, draikin <[EMAIL PROTECTED]> wrote:
> >> > Hi,
> >> >
> >> > i'am searching for a solution for the following problem. I want to
> >> > have a link on the pages of my little cakePHP app to allow to go back
> >> > to the page where i come from. So as the back-button of the browser.
> >> > For example: I search for a subset of my database entries and get a
> >> > page with a table containing the results. Now i want to edit one entry
> >> > and so i klick on the 'edit' link in the first column of the table. I
> >> > edit the entry, save it and want to go back to the result page. If i
> >> > dont want to edit, i will have a link on the edit page to go back to
> >> > the result page.
> >> > Did i describe the problem properly?
> >> > Can anyone give me a hint? I tried to find a solution, but i can't
> >> > find what i need.
> >> >
> >> > Many thanks,
> >> > draikin
> >
> > >
> >

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $ajax->drag - can't scroll inside draggable div

2008-08-22 Thread clemos

Hi

The right callback for creating your Draggable once your Ajax call is
done should be "oncomplete" (add "oncomplete":function(){new
Draggable...} to your Ajax request options)

++
Clément

On Fri, Aug 22, 2008 at 3:56 PM, meximex <[EMAIL PROTECTED]> wrote:
>
> i found out, that the handle parameter is supposed to handle this
> operation. my problem is that the object with the id for the handle is
> loaded upon ajax request success. but if i specify it in the 'after'
> parameter of the ajax load it ignores it.
>
> i solved this problem by doing this:
>  width="100%"/>
>
> this is quite dirty and i am looking for a better solution cause i can
> only drag it upon the second click.
>
> maybe someone can help.
>
> thx,
> mex
>
> On 22 Aug., 14:08, meximex <[EMAIL PROTECTED]> wrote:
>> hi have a draggable div. a main layout with a smaller scrollable area.
>> i just want to enable the dragging of the "window-layer" if the
>> heading is dragged. same like in windows.
>>
>> how can i do that?
>>
>> thx for your help.
>> mex
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $ajax->drag - can't scroll inside draggable div

2008-08-22 Thread clemos

Hi mex

This is not really a cake question, as $ajax->drag is actually a
wrapper of scriptaculous' Draggable object :
http://github.com/madrobby/scriptaculous/wikis/draggable
The "handle" option is what you're looking for. It'll give you something like :
$ajax->drag("div_id",array("handle"=>"heading_id"));
which will produce javascript code close to this:
new Draggable("div_id",{"handle":"heading_id"});

I personnally prefer to do it in plain javascript than the Cake way,
because it allows you to use selectors rather than dom ids, like:
new Draggable("div_id",{"handle":$("div_id").select("[name=heading]")[0]});
Then you can do a generic function to apply to all the divs you want
to make draggable:
function setDraggable(div){
   new Draggable($(div),{"handle":$(div).select("[name=heading]")[0]});
}
setDraggable("window1");
setDraggable("window2");

++
Clément

On Fri, Aug 22, 2008 at 2:08 PM, meximex <[EMAIL PROTECTED]> wrote:
>
> hi have a draggable div. a main layout with a smaller scrollable area.
> i just want to enable the dragging of the "window-layer" if the
> heading is dragged. same like in windows.
>
> how can i do that?
>
> thx for your help.
> mex
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $ajax->drag - can't scroll inside draggable div

2008-08-22 Thread meximex

i found out, that the handle parameter is supposed to handle this
operation. my problem is that the object with the id for the handle is
loaded upon ajax request success. but if i specify it in the 'after'
parameter of the ajax load it ignores it.

i solved this problem by doing this:


this is quite dirty and i am looking for a better solution cause i can
only drag it upon the second click.

maybe someone can help.

thx,
mex

On 22 Aug., 14:08, meximex <[EMAIL PROTECTED]> wrote:
> hi have a draggable div. a main layout with a smaller scrollable area.
> i just want to enable the dragging of the "window-layer" if the
> heading is dragged. same like in windows.
>
> how can i do that?
>
> thx for your help.
> mex
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



cakephp Linux

2008-08-22 Thread [EMAIL PROTECTED]

Hi, I ´m trying to install ang configure cake in linux and I dont now
how. I have no expierence neither in linux nor cake. I need step by
step the instructions.
Thank you very much...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using one login function on 2 different controllers

2008-08-22 Thread Dr. Tarique Sani

On Fri, Aug 22, 2008 at 6:37 PM, seanislegend
<[EMAIL PROTECTED]> wrote:
>
> Thanks for your suggestion. Sadly, I've already tried that and it
> doesn't work!
>

Can you elaborate on what does not work? Can you see the action of the
form set to users/login when you view the HTML source?

Tarique


-- 
=
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 
"CakePHP" 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
-~--~~~~--~~--~--~---



$ajax->drag - can't scroll inside draggable div

2008-08-22 Thread meximex

hi have a draggable div. a main layout with a smaller scrollable area.
i just want to enable the dragging of the "window-layer" if the
heading is dragged. same like in windows.

how can i do that?

thx for your help.
mex

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with recursive and contain

2008-08-22 Thread nastya

hi

I'm using 1.2 and have a strange problem.

there are three models:

   Author
   Theme
   Post which belongs to Author and Theme

now i want to get the Posts but with recursive =-1.
when i put:

 $this->paginate['recursive']=-1;
 $items = $this->paginate($this->modelClass,$scope);

i have an error:

   SQL Error: 1051: Unknown table 'Theme'

and query looks like this:

   Query: SELECT `Post`.*, `Theme`.*, `Author`.*,
`I18n__title`.`content`, `I18n__description`.`content` FROM `posts` AS
`Post` LEFT JOIN `i18n` AS `I18n__title` ON (`Post`.`id` =
`I18n__title`.`foreign_key` AND `I18n__title`.`model` = 'Post' AND
`I18n__title`.`field` = 'title') LEFT JOIN `i18n` AS
`I18n__description` ON (`Post`.`id` =
`I18n__description`.`foreign_key` AND `I18n__description`.`model` =
'Post' AND `I18n__description`.`field` = 'description') WHERE
`I18n__title`.`locale` = 'eng' AND `I18n__description`.`locale` =
'eng' ORDER BY `Post`.`place` ASC

the same query i get if i put:

   $this->Post->contain();
   $t=$this->Post->find('all');

or:

  $t=$this->Post->find('all',array('recursive'=>-1));

why does it look for Theme and Author??!!! It shouldn't do so, no?
If I don't mention contain or recursive -> it's ok: it finds all the
data. But if I try to get nice queries just with data that I need, it
doesn't work...
Can anyone help me please?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using one login function on 2 different controllers

2008-08-22 Thread seanislegend

Thanks for your suggestion. Sadly, I've already tried that and it
doesn't work!


On Aug 22, 12:17 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 22, 2008 at 4:18 PM, seanislegend
>
> <[EMAIL PROTECTED]> wrote:
> > What I need to do is to be able to have the form on the home page be
> > able to post to the login action on the users controller so I can also
> > login from there.
>
> Set the action of the form of the home page with something like
> $form->create('user', array('action'=>'/user/login'))
>
> HTH
>
> Tarique
>
> --
> =
> 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 
"CakePHP" 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
-~--~~~~--~~--~--~---



calling view element through ajax

2008-08-22 Thread f1codz

dear all,

im using $ajax->link() method,
is it then possible that i directly load a view element
(that is app/views/elements/myElement.ctp)
through the $ajax->link() method, instead of going through a
controller action

The basic problem is that certain pieces of my website need to loaded
only through
ajax, so they should not be accessible from the browser url
directly ...

please help
thanx
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



unit test password login

2008-08-22 Thread JuergenRiemer

HI,

I am unit testing a login function with  like so:

function testValidLogin(){

$data = array(
'User' => array(
'username' => 'usrname',
'balfoomuh' => 'apassword123'
)
);
$result = $this->testAction(
'/users/login',
array(
'fixturize' => false,
'data' => $data,
'return' => 'vars',
'method' => 'post'
)
);
}


in the login function I get for $this->data:

Array
(
[User] => Array
(
[username] => usrname
[balfoomuh] => apassword123
[blafoomuh] =>
)

)

and can't login correctly (get the proper redirect url);

Most probably it is because blafoomuh is my password field with the
Auth component any ideas why this is so and what to do to avoid that?

 thx
 Juergen



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using one login function on 2 different controllers

2008-08-22 Thread Dr. Tarique Sani

On Fri, Aug 22, 2008 at 4:18 PM, seanislegend
<[EMAIL PROTECTED]> wrote:
> What I need to do is to be able to have the form on the home page be
> able to post to the login action on the users controller so I can also
> login from there.

Set the action of the form of the home page with something like
$form->create('user', array('action'=>'/user/login'))

HTH

Tarique

-- 
=
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 
"CakePHP" 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: HABTM woes (cake_1.2.0.7296-rc2)

2008-08-22 Thread eleven10

Hi Jon,

I really appreciate your help. Thanks to you, I hope my cake will turn
out good :).

> that wasn't really my point, from your model setup something struck me
> as odd, though looking at it now I can't see it, so perhaps it's fine!

Generally gut reactions are true, so if you ever recall what you
though was odd, do let me know! :)
> > OK ... and I can get the list of associated _users_ only (and not
> > bids) for a bid session using bind/unbind or Containable behavior,
> > right?
>
> no!! you don't need to. The associated users will automatically be
> returned by cake, no subsequent query (call to a find method) or
> unbind/bind required. I suggest you analyse the the data outputted by:

What I meant was, BidSession is associated with both Bid & User, so a
recursion level > 0 will return both Bids and Users for that
particular session, so if I want only Users (or only Bids), I should
be using unbind/Containable ... am I correct?

> I don't think you can do a find(list) on a join table directly.
> Generally I do one of two things.
>
> a) When I have to deal with the data in the join table, I 'massage'
> the data (using the Set class) into the list I need (that's the
> example I provided) - I would use this to obtain the 'selected'
> indexes when dealing with a multiple select tag
> b) grab all the records to populate a multiple select tag
>
> neither of the above ever require me to directly access the join
> model, it's all handled automatically.

The join table will (for now, at least) be populated from an external
source. I just need to check if the logged-in user has registered for
the current bid session. Guess I can just do this (in
users_controller.php):
$this->User->BidSessionRegistration->find('count',
array('conditions' => array('BidSessionRegistration.user_id' =>
$userId, 'BidSessionRegistration.bid_session_id' => $bidSessionId)));

> > I'll try re-running the bake script on a fresh "install" and see if it
> > picks up the associations properly.
>
> I think you'd be better off skipping bake and getting your hands
> dirty. writing cake code is pretty quick, and you'll learn how things
> are tied together much better this way. Start at the blog 
> tutorialhttp://book.cakephp.org/view/219/blogand expand from there.

That's a most sensible suggestion :). I generally do things that way--
I love hand-coded html--this time I was just playing with the bake
script (or just call me lazy :)).

> You'll need to use with if you want extra columns in your habtm. it
> works really well, though I don't follow why you need multiple habtm
> associations between the same two models with 'with'. why not forget
> the with and set the condition on each habtm.
>
> var $hasAndBelongsToMany = array(
>         'UsersCalledJoe'=>array(
>                 'model'=>'User'
>                 'joinTable' => 'bid_session_registrations',
>                 'name'=>'Joe'
>         )
> );

Unfortunately I need to track extra variables in the Bid model--e.g.
points bid, time of bid submission, etc etc. So I think I have to use
the 'with' param.

> I think that's best posted as a separate message, as I don't know
> anything about exchange server, sorry!

Sorry if it sounded Exchange specific ... it's just plain POP3
authentication. I think I will handle that on my own; even the OpenID
component (which is conceptually similar) is separate from the Auth
component--ahh, if only Auth was plugin-based!


Thanks and regards,
Amitava
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



To write my database records in Excel

2008-08-22 Thread Fredy

 In servlets we hav the option of writing into a Excel / word file
straight away usin
contentype() method Is there any similair way to write my mysql
database records into
Excel sheet using php or else is there some other way ...

I need to Generate Reports from my database ... dynamic reports(Excel
sheet ) how to do it in php .

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Using one login function on 2 different controllers

2008-08-22 Thread seanislegend

Hi,

I have a user admin section. I'm using the Auth component and in this
section I have a login action which, as you may guess, handles the
login.

I also have a login form on my home page.

What I need to do is to be able to have the form on the home page be
able to post to the login action on the users controller so I can also
login from there.

Any suggestions?

Thanks

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM woes (cake_1.2.0.7296-rc2)

2008-08-22 Thread Jon Bennett

Hi amitava,

>> Ok, first thing is I think it might be a good idea to not have
>> duplicate association names, you Currently have
>>
>> Bid belongsTo User,BidSession
>> BidSession hasMany Bid
>> BidSession hasAndBelongsToMany User
>> User hasMany Bid
>> User hasAndBelongsToMany BidSession
>>
>> I really think you'd be better off calling the last one
>> BidSessionRegistrations, to avoid confusion internally.
>
> Well, don't I need to declare the habtm relationship in both the
> models if I want to list students registered for a particular session
> as well as list bid sessions a particular student has registered for
> (to be used in a different context)?

that wasn't really my point, from your model setup something struck me
as odd, though looking at it now I can't see it, so perhaps it's fine!

>> When you do (line 116):
>>
>> $users = $this->BidSession->User->find('list');
>>
>> you aren't asking cake to grab the users from a particular session,
>> you are tunnelling directly to the User model and finding ALL users!
>> The easiest way to get the Users for a particular BidSession is let
>> cake do it for you by increasing the recursive level above 0 on the
>> BidSession model. If you have linked up any users to a BidSession,
>> they will automatically be retrieved by cake unless you ask them not
>> to be when you find the BidSession record.
>
> OK ... and I can get the list of associated _users_ only (and not
> bids) for a bid session using bind/unbind or Containable behavior,
> right?

no!! you don't need to. The associated users will automatically be
returned by cake, no subsequent query (call to a find method) or
unbind/bind required. I suggest you analyse the the data outputted by:

debug($this->Big->find('first', array('Bid.id'=>$bid_id, 'recursive'=>3));

>> I think the problem with line 170:
>>
>> $bidSessionRegistrations = $this->User->BidSessionRegistration->find('list');
>>
>>  is that cake defaults to using 'id', 'name' for the fields in
>> find('list'), if you want need something other than that you have to
>> explicitly tell cake.
>
> Yeah, my bad ... the documentation says so ... and of course the bake
> script wouldn't know which fields I'd want ... but may be it can
> default to the two FKs (since it knows this is a join table)?

I don't think you can do a find(list) on a join table directly.
Generally I do one of two things.

a) When I have to deal with the data in the join table, I 'massage'
the data (using the Set class) into the list I need (that's the
example I provided) - I would use this to obtain the 'selected'
indexes when dealing with a multiple select tag
b) grab all the records to populate a multiple select tag

neither of the above ever require me to directly access the join
model, it's all handled automatically.

> I'll try re-running the bake script on a fresh "install" and see if it
> picks up the associations properly.

I think you'd be better off skipping bake and getting your hands
dirty. writing cake code is pretty quick, and you'll learn how things
are tied together much better this way. Start at the blog tutorial
http://book.cakephp.org/view/219/blog and expand from there.

> I would like to have your opinion on the following points:
> A. You'll notice that UserBidSession is a "through"
> association, so I could use the "with" condition ... my question is,
> will it be too confusing if I have multiple habtm associations between
> the same two models? Anyway I'll try this and post what I find.

You'll need to use with if you want extra columns in your habtm. it
works really well, though I don't follow why you need multiple habtm
associations between the same two models with 'with'. why not forget
the with and set the condition on each habtm.

var $hasAndBelongsToMany = array(
'UsersCalledJoe'=>array(
'model'=>'User'
'joinTable' => 'bid_session_registrations',
'name'=>'Joe'
)
);

> B. We authenticate logins against our Exchange server, so the users
> table doesn't store any passwords ... how difficult is it to use the
> Auth component in this setup? Am I better off writing my own
> authentication routine?

I think that's best posted as a separate message, as I don't know
anything about exchange server, sorry!

hope this helps,

jon


-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP without database access. Webservices only

2008-08-22 Thread Dr. Tarique Sani

On Fri, Aug 22, 2008 at 2:49 PM, clemos <[EMAIL PROTECTED]> wrote:
>
> I guess they want no tables ($useTable), but also no database at all...
> Because even if you don't use tables at all, you'll need a database
> connection to make Cake work...
> Maybe a "dummy" datasource / db driver would be possible...


Yes, create app/models/datasources/dbo/dbo_my_dbo_source.php

add

class DboMyDboSource extends DboSource
{
function connect()
{
$this->connected = true;
return $this->connected;
}

function disconnect()
{
$this->connected = false;
return !$this->connected;
}
}

and use it by putting in database.php  'driver' => 'my_dbo_source'

Note: This is in addition putting useTable = false in your models

However a more elegant idea would be to abstract more of your
webservice into the dbosource - we did this recently for Salesforge
API

HTH
Tarique

P.S. Probably disconnect method is not needed - experiment with it

--
=
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 
"CakePHP" 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: Should I be using a custom query?

2008-08-22 Thread eagle

Thanks Richard,  I had tried that already, and it works fine when
viewing contacts but not for retrieving just the 'main' contact when
viewing the venues.  The venue page is not reading the conditions set
in the contacts_controller.  It is basically a SELECT * FROM contacts
not a SELECT * FROM CONTACTS WHERE jobType = 'main' which is what I
thought I was setting.
Thanks


On Aug 22, 9:23 am, RichardAtHome <[EMAIL PROTECTED]> wrote:
> $contacts = $this->Contact->find('first',
> array(
> 'conditions' =>
> array('Contact.jobType' => 'main)
> )
> );
>
> Note the 'first' parameter.
>
> On Aug 22, 12:40 am, eagle <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > First of I'm new to Cake and tryign it out for the first time - I've
> > searched here and on Google to solve what I suspect will be an
> > idiotically simple question 
>
> > Two tables:
> > VENUES hasmany CONTACTS
> > all linked in the models correctly
>
> > On my default view of the venues table I want to filter the contacts
> > to display only one of the potentially many based on a field value of
> > 'main'.
>
> > venues_controller::index() is
> > $this->Venue->recursive = 1;
> > $this->set('venues',$this->paginate('Venue'));
> > $venues = $this->Venue->find('all');
>
> > and contacts_controller::index() is
> > $this->Contact->recursive = 1;
> > $contacts = $this->Contact->find('all',
> > array(
> > 'conditions' => array('Contact.jobType' => 
> > 'main)
> > )
> > );
> > $this->set('contacts', $contacts);
>
> > I can retrieve all contacts for a venue on the index view for venues,
> > but I only want the 'main' one.
>
> > Should I set up a custom query in the venues_controller to do this? Or
> > am I missing somehting more obvious?
>
> > Thanks for any guidance.
>
> > Eagle
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP without database access. Webservices only

2008-08-22 Thread clemos

I guess they want no tables ($useTable), but also no database at all...
Because even if you don't use tables at all, you'll need a database
connection to make Cake work...
Maybe a "dummy" datasource / db driver would be possible...

+++
Clément

On Fri, Aug 22, 2008 at 7:51 AM, chovy <[EMAIL PROTECTED]> wrote:
>
>
>
> On Aug 13, 8:49 am, Bob Mattax <[EMAIL PROTECTED]> wrote:
>> I am working on a current application that doesn't have any direct
>> access to the database.  The powers that be have limited all data
>> requests and updates through a series of webservices.  No big deal.
>>
>> The only problem I have is trying to prevent Cake from going through
>> the motions of requiring a default DB config etc.
>>
>> When I have debugging set to 3, it will still give me the FATAL
>> warning that it can't find my DB.
>>
>> useTable = null/false  does not work.
>>
>> Any suggestions?
>>
>
>
> I have the exact same need right now. I've looked at Rails, but cannot
> find any good examples on this (everything is geared towards providing
> a web service, not consuming one).
>
> Please, *please* let me know if you find a way to do it that still
> takes advantage of MVC, and generators, etc.
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM woes (cake_1.2.0.7296-rc2)

2008-08-22 Thread eleven10

Hi,

> Ok, first thing is I think it might be a good idea to not have
> duplicate association names, you Currently have
>
> Bid belongsTo User,BidSession
> BidSession hasMany Bid
> BidSession hasAndBelongsToMany User
> User hasMany Bid
> User hasAndBelongsToMany BidSession
>
> I really think you'd be better off calling the last one
> BidSessionRegistrations, to avoid confusion internally.

Well, don't I need to declare the habtm relationship in both the
models if I want to list students registered for a particular session
as well as list bid sessions a particular student has registered for
(to be used in a different context)?


> When you do (line 116):
>
> $users = $this->BidSession->User->find('list');
>
> you aren't asking cake to grab the users from a particular session,
> you are tunnelling directly to the User model and finding ALL users!
> The easiest way to get the Users for a particular BidSession is let
> cake do it for you by increasing the recursive level above 0 on the
> BidSession model. If you have linked up any users to a BidSession,
> they will automatically be retrieved by cake unless you ask them not
> to be when you find the BidSession record.

OK ... and I can get the list of associated _users_ only (and not
bids) for a bid session using bind/unbind or Containable behavior,
right?

> I think the problem with line 170:
>
> $bidSessionRegistrations = $this->User->BidSessionRegistration->find('list');
>
>  is that cake defaults to using 'id', 'name' for the fields in
> find('list'), if you want need something other than that you have to
> explicitly tell cake.

Yeah, my bad ... the documentation says so ... and of course the bake
script wouldn't know which fields I'd want ... but may be it can
default to the two FKs (since it knows this is a join table)?

I'll try re-running the bake script on a fresh "install" and see if it
picks up the associations properly.

I would like to have your opinion on the following points:
A. You'll notice that UserBidSession is a "through"
association, so I could use the "with" condition ... my question is,
will it be too confusing if I have multiple habtm associations between
the same two models? Anyway I'll try this and post what I find.
B. We authenticate logins against our Exchange server, so the users
table doesn't store any passwords ... how difficult is it to use the
Auth component in this setup? Am I better off writing my own
authentication routine?


Thanks a lot for your help!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP without database access. Webservices only

2008-08-22 Thread chovy



On Aug 13, 8:49 am, Bob Mattax <[EMAIL PROTECTED]> wrote:
> I am working on a current application that doesn't have any direct
> access to the database.  The powers that be have limited all data
> requests and updates through a series of webservices.  No big deal.
>
> The only problem I have is trying to prevent Cake from going through
> the motions of requiring a default DB config etc.
>
> When I have debugging set to 3, it will still give me the FATAL
> warning that it can't find my DB.
>
> useTable = null/false  does not work.
>
> Any suggestions?
>


I have the exact same need right now. I've looked at Rails, but cannot
find any good examples on this (everything is geared towards providing
a web service, not consuming one).

Please, *please* let me know if you find a way to do it that still
takes advantage of MVC, and generators, etc.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Can render() work in this way???

2008-08-22 Thread vibhor

Hello all,

I want to generate a dynamic table using ajax inside a view page of my
application.
Th url of my view page is like this:

http:/.../projects/view/16

I want to know, since I am on the view page now, so should the render
function in my action be like this??

$this->render('view/16', 'ajax');

I tried many times but could not succeed. Can anyone please help me in
this.
Please let me know if anyone needs more detail.

Thanks,
Vibhor
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to do multiple hasmany

2008-08-22 Thread RichardAtHome

You need to combine them both into 1 hasMany array:

var $hasMany = array(
  'Childclass1'  => array(
'className' => 'Childclass1'
  ),
  'Childclass2'  => array(
'className' => 'Childclass2'
  )
);

On Aug 22, 12:43 am, robert123 <[EMAIL PROTECTED]> wrote:
> i have parent model, it has two hasmany child model,
>
> in the model class, I tried to model this relation by writing two time
> in the parent model class
>
>  var $hasMany = array('Childclass1'  =>
>array('className' =>
> 'Childclass1');
>
>  var $hasMany = array('Childclass2'  =>
>array('className' =>
> 'Childclass2');
>
> but it giving me the below error
> Cannot redeclare Childclass2::$hasMany
>
> anyone can let me know, how to solve this, thank you
>
> http://www.generics.ws/jpn/レビトラ(塩酸バルデナフィルHCL_)に20_MGについて-p-115.htmlhttp://www.generics.ws/jpn/プロペシア(フィナステライド)-p-4.htmlhttp://www.generics.ws/jpn/バイアグラ(クエン酸シルデナフィル)-p-2.html
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Should I be using a custom query?

2008-08-22 Thread RichardAtHome

$contacts = $this->Contact->find('first',
array(
'conditions' =>
array('Contact.jobType' => 'main)
)
);


Note the 'first' parameter.

On Aug 22, 12:40 am, eagle <[EMAIL PROTECTED]> wrote:
> Hi,
> First of I'm new to Cake and tryign it out for the first time - I've
> searched here and on Google to solve what I suspect will be an
> idiotically simple question 
>
> Two tables:
> VENUES hasmany CONTACTS
> all linked in the models correctly
>
> On my default view of the venues table I want to filter the contacts
> to display only one of the potentially many based on a field value of
> 'main'.
>
> venues_controller::index() is
> $this->Venue->recursive = 1;
> $this->set('venues',$this->paginate('Venue'));
> $venues = $this->Venue->find('all');
>
> and contacts_controller::index() is
> $this->Contact->recursive = 1;
> $contacts = $this->Contact->find('all',
>                         array(
>                                 'conditions' => array('Contact.jobType' => 
> 'main)
>                                 )
>                         );
> $this->set('contacts', $contacts);
>
> I can retrieve all contacts for a venue on the index view for venues,
> but I only want the 'main' one.
>
> Should I set up a custom query in the venues_controller to do this? Or
> am I missing somehting more obvious?
>
> Thanks for any guidance.
>
> Eagle
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



User Model and its associations in AuthComponent

2008-08-22 Thread phpcurious

Hi guys,

Let's say, I have User model and it "belongsTo" a Group Model...

I use AuthComponent to authenticate users like in user login. but when
I dump the
$_SESSION the user object in Session doesn't have its association to
the Group Model.

what is the proper way to associate my user in active session to the
Group model,so I could classify if the user is a super user like,

   if($this->Auth->user('Group.alias') == 'superuser') {
 ...


note: I am just asking the guys who might have other opinions on
this...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---