Re: Question about Routing (domain.com/{cityname}/controller/action)

2010-05-26 Thread Bennet Jeutter
Works perfect, thanks :)

On 25 Mai, 14:25, emanuele  wrote:
> Router::connect('/:alias/:controller/:action/*',
>         array(),
>         array(
>             'persist' => array('alias'),
>             ));
>
> On Tue, May 25, 2010 at 10:32 AM, Bennet Jeutter
> wrote:
>
>
>
> > Hallo everyone,
>
> > I got a question about routing:
> > I'm developing a project, which is based on cities.
> > So i want to have URLs like 
> > domain.com/{cityname}/controller/action
> > .
> > Example: domain.com/frankfurt/people/view/3
>
> > The Controller and Actions should be for alle Cities the same, I would
> > catche the city in the AppController for use in the Controllers.
>
> > Is there any way to do this?
>
> > Best regards,
> >  Bennet Jeutter
>
> > 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
>
> --
> Emanuele Gringeri
> Computer Engineer
> University of Pisa
> Be my mirror, my sword and shield
>
> 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: can anyone send me the sql file of world country and city list

2010-05-26 Thread Blackbit
That's a lot... Maybe you can ask google for their database^^

On 27 Mai, 06:17, Shahjahan Russell  wrote:
> can anyone please help me on this issue
>
> i need the world country and city list..

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


can anyone send me the sql file of world country and city list

2010-05-26 Thread Shahjahan Russell
can anyone please help me on this issue

i need the world country and city list..

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: Problem with database cascade relationships.

2010-05-26 Thread Jeremy Burns
All of your table and field names should be lower case.

What is your full find statement? Can you post it all, not just a small piece.

Jeremy Burns
jeremybu...@me.com


On 27 May 2010, at 00:22, 朝の木 wrote:

> I have three models (with controllers):
> - Product: Id, Title, Type_id
> - Type: Id, Description
> - ProductItem: Id, Product_id, Size, Sold_time
> 
> Relationships:
> - Product: belongsTo(Type), hasMany(ProductItem)
> - Type: hasMany(Product)
> - ProductItem: belongsTo(Product)
> 
> Example:
> - Product:
>  1; 'Star Jeans 502', 4
>  (...)
> 
> - Type:
>  4; 'Trousers'
>  (...)
> 
> - ProductItem:
>  7; 1; 'S', NULL
>  8; 1; 'S', NULL
>  9; 1; 'S', NULL
>  10; 1; 'M', NULL
>  11; 1; 'M', NULL
>  12; 1; 'L', NULL
>  (...)
> 
> Now, I'd like to fetch the in such way:
> Description, Type, Size, Count
> Star Jeans 502, 'Trousers', 'S', 3
> Star Jeans 502, 'Trousers', 'M', 2
> Star Jeans 502, 'Trousers', 'L', 1
> 
> The sql query should look like this:
> select Product.Title, Type.Description, ProductItem.Size,
> COUNT(ProductItem.*)
> left join Type on Product.Type_id = Type.id left join ProductItem on
> ProductItem.Product_id = Product.id
> group by Product.Id, ProductItem.Size
> 
> Is it correct?
> 
> I want to make such sql in cakephp in automagicalled way using find in
> ProductItem controller. Unfortunately it does not work. I tried find
> with parameter: field => (Product.Title, Type.Description,
> ProductItem.Size, COUNT(ProductItem.*)) and group => (Product.Id,
> ProductItem.Size), but cake doesn't want to put join on ProductType.
> 
> I think that cake builds joins only for tables in relations with
> current model (ProductItem), and does not look deeper -
> "belongsTo(Type)" is defined in Product model.
> 
> How to solve this problem?
> 
> Kind regards,
> T.
> 
> 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: Avoiding $uses but binding not giving a result?

2010-05-26 Thread Filipe Teles Rodrigues
You are using the plural. Try $this->Article->Comment->CommentsRank

2010/5/26 Shaz 

> I have:
>
> Article [hasmany] Comment [hasmany] CommentRank
> CommentRank [belongsto] Comment [belongsto] Article
>
> I try to use (in the articles controller) $this->Article->Comments-
> >CommentsRanks->read() but it results in “Undefined property:
> AppModel::$CommentsRanks”
>
> I am trying to avoid using $uses as the models are related to one
> another; but the binding only goes as far as $this->Article->Comments,
> any advice on why it is not going further? I have tried the different
> recursive levels to no avail.
>
> 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: Join table question

2010-05-26 Thread Jeremy Burns
This ought to be fine - are you having problems?
http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM

Jeremy Burns
jeremybu...@me.com


On 26 May 2010, at 22:21, Roland Pish wrote:

> Hello.
> I have two tables with a many-to-many relationship between them:
> practitioners and practice_areas.
> So, the join table name should be: practice_areas_practitioners? Is
> this correct according to cakephp conventions?
> Is more than one underscore allowed for a join table name?
> 
> I'm afraid that I will have another many-to-many relationship between
> practitioners and a table called state_license_numbers, so the join
> table should be named: practitioners_state_license_numbers?
> 
> Thanks a lot in advance.
> 
> Regards.
> 
> 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: Avoiding $uses but binding not giving a result?

2010-05-26 Thread Jeremy Burns
You have added 'S's to your model names. Try:

$this->Article->Comment->CommentRank->read()

Jeremy Burns
jeremybu...@me.com


On 26 May 2010, at 18:34, Shaz wrote:

> I have:
> 
> Article [hasmany] Comment [hasmany] CommentRank
> CommentRank [belongsto] Comment [belongsto] Article
> 
> I try to use (in the articles controller) $this->Article->Comments-
>> CommentsRanks->read() but it results in “Undefined property:
> AppModel::$CommentsRanks”
> 
> I am trying to avoid using $uses as the models are related to one
> another; but the binding only goes as far as $this->Article->Comments,
> any advice on why it is not going further? I have tried the different
> recursive levels to no avail.
> 
> 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


XMLHttpRequest bypassing Auth component

2010-05-26 Thread heratech
this has been posted before by someone else but there was no answer
http://groups.google.com/group/cake-php/browse_thread/thread/9b15f3038a95cd30/a80797d08a1b5517?lnk=gst&q=auth&pli=1

basically the auth component works fine if i browse to the json page
using my browser but if it uses the xmlhttprequest post it doesnt seem
to be a requirement that i am logged in?
is this the correct behaviour. how do i change it?

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


Problem with database cascade relationships.

2010-05-26 Thread 朝の木
I have three models (with controllers):
- Product: Id, Title, Type_id
- Type: Id, Description
- ProductItem: Id, Product_id, Size, Sold_time

Relationships:
- Product: belongsTo(Type), hasMany(ProductItem)
- Type: hasMany(Product)
- ProductItem: belongsTo(Product)

Example:
- Product:
  1; 'Star Jeans 502', 4
  (...)

- Type:
  4; 'Trousers'
  (...)

- ProductItem:
  7; 1; 'S', NULL
  8; 1; 'S', NULL
  9; 1; 'S', NULL
  10; 1; 'M', NULL
  11; 1; 'M', NULL
  12; 1; 'L', NULL
  (...)

Now, I'd like to fetch the in such way:
Description, Type, Size, Count
Star Jeans 502, 'Trousers', 'S', 3
Star Jeans 502, 'Trousers', 'M', 2
Star Jeans 502, 'Trousers', 'L', 1

The sql query should look like this:
select Product.Title, Type.Description, ProductItem.Size,
COUNT(ProductItem.*)
left join Type on Product.Type_id = Type.id left join ProductItem on
ProductItem.Product_id = Product.id
group by Product.Id, ProductItem.Size

Is it correct?

I want to make such sql in cakephp in automagicalled way using find in
ProductItem controller. Unfortunately it does not work. I tried find
with parameter: field => (Product.Title, Type.Description,
ProductItem.Size, COUNT(ProductItem.*)) and group => (Product.Id,
ProductItem.Size), but cake doesn't want to put join on ProductType.

I think that cake builds joins only for tables in relations with
current model (ProductItem), and does not look deeper -
"belongsTo(Type)" is defined in Product model.

How to solve this problem?

Kind regards,
T.

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


Join table question

2010-05-26 Thread Roland Pish
Hello.
I have two tables with a many-to-many relationship between them:
practitioners and practice_areas.
So, the join table name should be: practice_areas_practitioners? Is
this correct according to cakephp conventions?
Is more than one underscore allowed for a join table name?

I'm afraid that I will have another many-to-many relationship between
practitioners and a table called state_license_numbers, so the join
table should be named: practitioners_state_license_numbers?

Thanks a lot in advance.

Regards.

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


Avoiding $uses but binding not giving a result?

2010-05-26 Thread Shaz
I have:

Article [hasmany] Comment [hasmany] CommentRank
CommentRank [belongsto] Comment [belongsto] Article

I try to use (in the articles controller) $this->Article->Comments-
>CommentsRanks->read() but it results in “Undefined property:
AppModel::$CommentsRanks”

I am trying to avoid using $uses as the models are related to one
another; but the binding only goes as far as $this->Article->Comments,
any advice on why it is not going further? I have tried the different
recursive levels to no avail.

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


Fixtures based on models with a table prefix defined.

2010-05-26 Thread carcus88
I am trying to create a fixture for a model where the model has a
table prefix using the current release of CakePHP 1.3

The model this is base on is called StateProvince

I have the following model class code
[code]

[/code]

I have created a fixture for this as follows

[code]
 'StateProvince',
   'records' => true,
   'connection' => 'default');

}
?>
[/code]


And a test case like this
[code]
StateProvice =& ClassRegistry::init('StateProvice');
$result = $this->StateProvice->find('all');
$this->assertEqual(true, is_array($result));
}
}
?>
[/code]

When I try to run this test case is looks like its trying to setup the
model to get data to import into the fixture but I get the following
errors.

Warning (2): pg_query() [function.pg-query]: Query failed: ERROR:
relation "state_provinces" does not exist [CORE\cake\libs\model
\datasources\dbo\dbo_postgres.php, line 167]


Warning (512): SQL Error: ERROR:  relation "state_provinces" does not
exist [CORE\cake\libs\model\datasources\dbo_source.php, line 666]


Is there a bug in the fixtures code where it does not use the models
prefix when trying to import the structure into the fixture?

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: about Singleton instance

2010-05-26 Thread len

Thank you very much! :-)

On 2010/05/27 1:18, Miles J wrote:

Its a multiton instance.

http://en.wikipedia.org/wiki/Multiton_pattern

On May 26, 3:35 am, len  wrote:
   

Hi All

I have a question about Singleton instance.

cake/libs/configure.php L133

function&getInstance($boot = true) {
  static $instance = array();
  if (!$instance) {
  $instance[0] =&new Configure();
  $instance[0]->__loadBootstrap($boot);
  }
  return $instance[0];

}

why type of $instance is array.

Is the following ok?

static $instance;
if (!$instance) {
  $instance =&new Configure();

}

Thanks in advanced

len
 

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


Updating text field and observing drop down list using ajax helper

2010-05-26 Thread nashrul

Has anyone has a working example on using ajax helper to update text field
when we observe drop down list ?
I follow ajax helper on
http://www.croyantdebridiers.com/CakePHP_AJAX_selectbox_demo/ajaxcombobox/users/add
to update drop down list  and it worked fine for me. 
But, when I tried to modify  a code a little bit to update text field, I
found it didn't work.
Here's what I have:
create('');
echo
$form->select('document_type_id',array($docTypes),null,array('id'=>'document'),true);
 

echo $form->input('document_number', array('id'=>'docnum'));

echo
$ajax->observeField('document',array('url'=>'populate_document_select','update'=>'docnum'));
echo $form->end('Save');

?>

I'm trying to pass value returned by ajax controller function
(populate_document_select) to the view and update the text field but the
text field stays empty.

Any help would be greatly appreciated..
Thanks
I use cakephp 1.2

-- 
View this message in context: 
http://old.nabble.com/Updating-text-field-and-observing-drop-down-list-using-ajax-helper-tp28688782p28688782.html
Sent from the CakePHP mailing list archive at Nabble.com.

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: HABTM Containable find('all') question

2010-05-26 Thread bradmaxs
Hi Paul,

Thanks so much for getting back to me.  I can tell you I have learned
a lot from your posts since I have started using cake so thank you.

Here is the sql statement:

23  SELECT `User`.`id`, `User`.`username`, `User`.`first_name`,
`User`.`last_name`, `User`.`city`, `User`.`state`, `User`.`country`,
`User`.`created`, `UserPreference`.`image` FROM `users` AS `User` LEFT
JOIN `user_preferences` AS `UserPreference` ON
(`UserPreference`.`user_id` = `User`.`id`) WHERE `User`.`id` != 4
ORDER BY `User`.`first_name` asc LIMIT 15
24  SELECT `friend`.`id`, `Friend`.`id`, `Friend`.`user_id`,
`Friend`.`friend_id`, `Friend`.`approved`, `Friend`.`message`,
`Friend`.`created`, `Friend`.`modified` FROM `users` AS `friend` JOIN
`friends` AS `Friend` ON (`Friend`.`user_id` IN (3, 28, 29, 5) AND
`Friend`.`friend_id` = `friend`.`id`) WHERE `friend`.`id` = 4 AND
`Friend`.`approved` != -1
25  SELECT `admirer`.`id`, `admirer`.`created`, `Friend`.`id`,
`Friend`.`user_id`, `Friend`.`friend_id`, `Friend`.`approved`,
`Friend`.`message`, `Friend`.`created`, `Friend`.`modified` FROM
`users` AS `admirer` JOIN `friends` AS `Friend` ON
(`Friend`.`friend_id` IN (3, 28, 29, 5) AND `Friend`.`user_id` =
`admirer`.`id`) WHERE `admirer`.`id` = 4 AND `Friend`.`approved` !=
-1

So, the USER record is showing up and the FRIEND array is not so
actually it is right.  However, I just want the USER records who's
Friend.approved == 0 or 1.

I put Friend.approved in the main conditions of the find() and it
comes back with a 1054 Unknown Column error:)

Thanks in advance.

Brad


On May 26, 12:13 am, WebbedIT  wrote:
> Have you debugged the sql queries (set debug to 2) to work out where
> the sql is not being generated correctly as the condition in principle
> looks correct.
>
> Maybe just typos but a few things look off
>
>   'Friend' => array(
>     'conditions' => array(
>       'Friend.id =' => $this->Auth->user('id'),
>       'Friend.approved !=' => '-1'
>     )
>   ),
>   'Admirer' => array(
>     'conditions' => array(
>       'Admirer.id =' => $this->Auth->user('id'),
>       'Friend.approved !=' => '-1'
>     )
>   ),
>
> Friend and Admirer should be referenced with capital first letters and
> there's no need to wrap conditions in AND array as that is what is
> used by default.
>
> HTH
>
> Paul.
>
> On May 26, 1:28 am, bradmaxs  wrote:
>
> > Hello,
>
> > I am working on a HABTM relationship.
>
> > Here is my controller action:
>
> >         function index() {
> >                 $this->User->Behaviors->attach('Containable');
> >                 $this->paginate = array(
> >                         'contain' => array(
> >                                 'friend' => array(
> >                                         'conditions' => array(
> >                                                 'friend.id =' => 
> > $this->Auth->user('id'),
> >                                         )
> >                                 ),
> >                                 'admirer' => array(
> >                                         'conditions' => array(
> >                                                 'admirer.id =' => 
> > $this->Auth->user('id'),
> >                                         )
> >                                 ),
> >                                 'UserPreference.image'
> >                         ),
> >                         'conditions' => array(
> >                                 'User.id !=' => $this->Auth->user('id')
> >                         ),
> >                         'recursive' => true,
> >                         'limit' => 15,
> >                         'order' =>  array(
> >                                 'User.first_name' => 'asc'
> >                         )
> >                 );
> >                 $users = $this->paginate('User');
> >                 $this->set(compact('users'));
> >         }
>
> > In my User model:
>
> >         var $hasAndBelongsToMany = array(
> >                 'friend' => array('className' => 'User',
> >                 'joinTable' => 'Friend',
> >             'foreignKey' => 'user_id',
> >                         'associationForeignKey' => 'friend_id'
> >                 ),
> >                 'admirer' => array('className' => 'User',
> >                         'joinTable' =>'Friend',
> >                         'foreignKey' => 'friend_id',
> >                         'associationForeignKey' => 'user_id')
> >         );
>
> > I have a column in the Friend table that has approved which is by
> > default 0.  When someone approves, they get a 1 and if someone rejects
> > they get a -1.
>
> > In my index view I would like to exclude all Friend.approved => -1.
>
> > Here is the dump:
>
> > Array
> > (
> >     [0] => Array
> >         (
> >             [id] => 4
> >             [username] => xxx
> >             [password] => xxx
> >             [first_name] => xxx
> >             [last_name] => xxx
> >             [street_address] => xxx
> >             [city] => xxx
> >

Re: 404 error since updating to 1.3

2010-05-26 Thread Ed Propsner
The security component was indeed the problem (404 error should have been a
huge clue). I was confident that I had my restrictions set up correctly in
beforeFilter().



On Wed, May 26, 2010 at 3:38 PM, Ed Propsner  wrote:

> @Ernesto: >> Interesting, the only two controllers that are giving me
> problems are the only two controllers that happen to be using the security
> component.
>
> Did the problem go away when you rolled back?
>
>
> On Wed, May 26, 2010 at 10:09 AM, Ernesto  wrote:
>
>> are you guys using SecurityComponent?
>>
>> On 26 Mag, 16:05, Ernesto  wrote:
>> > same problem here.
>> >
>> > rolled back to RC4 :)
>> >
>> > On 26 Mag, 12:24, Ed Propsner  wrote:
>> >
>> >
>> >
>> > > I just updated to 1.3 stable from RC4 yesterday and I've been having
>> the
>> > > same exact problem (amongst a few others) ever since.
>> >
>> > > I have to toy with it some more but it seems to only happen when
>> passing
>> > > data into the controller action. As soon as the action sees
>> $this->data
>> > > it dies. Even debug($this->data) causes it to fail.
>> >
>> > > I'm still toying with it and I'll re-post if I come up with anything
>> worth
>> > > while. In the meantime it would be great to know if anyone had the
>> same
>> > > problem and how they resolved it 8-)
>> >
>> > > - Ed
>> >
>> > > On Wed, May 26, 2010 at 5:21 AM, Taff 
>> wrote:
>> > > > Hi,
>> > > > since updating my app to 1.3, one of my controllers is throwing a
>> 404.
>> > > > All the other controllers/methods are working properly. I took a
>> look
>> > > > at the controller and it's all the initial add edit delete view
>> > > > methods created during baking. Where should I start looking for the
>> > > > error, as I'm at a loss.
>> >
>> > > > Debugging is turned on but I'm still getting the 404 with no
>> debugging
>> > > > information. The error is "The requested URL /app/webroot/webcasts/
>> > > > index/language:deu was not found on this server." Any help would be
>> > > > greatly appreciated.
>> >
>> > > > Cheers,
>> > > > Taff
>> >
>> > > > 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 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


Two application same path

2010-05-26 Thread Jose Julian Abarca
hi how to can have a application into / y other /proyectos the first with
cakephp1.3 y the other with cakephp1.2
Thank!!
PD. subdomain not is a solution

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: Auto relationship

2010-05-26 Thread John Andersen
Take a look at the CakePHP book at:
http://book.cakephp.org/view/851/Multiple-relations-to-the-same-model

which explains about more than one relationships to another (or
itself) model.

That should help you decide how to define your column
(categoria_id) :)
Enjoy,
   John

On May 26, 10:18 pm, Celso  wrote:
> How is the best way in cake?
> This: ?
>
> 
> class Categoria extends AppModel{
>
>         var $belongsTo  = array('Categoria');
>         var $hasMany    = array('Categoria');
>
> }
>
> ?>
>
> In database, i will put parent_id or categoria_id ???
>
> Thanks,
> Celso.

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: 404 error since updating to 1.3

2010-05-26 Thread Ed Propsner
@Ernesto: >> Interesting, the only two controllers that are giving me
problems are the only two controllers that happen to be using the security
component.

Did the problem go away when you rolled back?

On Wed, May 26, 2010 at 10:09 AM, Ernesto  wrote:

> are you guys using SecurityComponent?
>
> On 26 Mag, 16:05, Ernesto  wrote:
> > same problem here.
> >
> > rolled back to RC4 :)
> >
> > On 26 Mag, 12:24, Ed Propsner  wrote:
> >
> >
> >
> > > I just updated to 1.3 stable from RC4 yesterday and I've been having
> the
> > > same exact problem (amongst a few others) ever since.
> >
> > > I have to toy with it some more but it seems to only happen when
> passing
> > > data into the controller action. As soon as the action sees $this->data
> > > it dies. Even debug($this->data) causes it to fail.
> >
> > > I'm still toying with it and I'll re-post if I come up with anything
> worth
> > > while. In the meantime it would be great to know if anyone had the same
> > > problem and how they resolved it 8-)
> >
> > > - Ed
> >
> > > On Wed, May 26, 2010 at 5:21 AM, Taff 
> wrote:
> > > > Hi,
> > > > since updating my app to 1.3, one of my controllers is throwing a
> 404.
> > > > All the other controllers/methods are working properly. I took a look
> > > > at the controller and it's all the initial add edit delete view
> > > > methods created during baking. Where should I start looking for the
> > > > error, as I'm at a loss.
> >
> > > > Debugging is turned on but I'm still getting the 404 with no
> debugging
> > > > information. The error is "The requested URL /app/webroot/webcasts/
> > > > index/language:deu was not found on this server." Any help would be
> > > > greatly appreciated.
> >
> > > > Cheers,
> > > > Taff
> >
> > > > 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 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: Server does not support .htaccess files

2010-05-26 Thread calvin
Why not just find a better web host, like DreamHost? They offer more
space/bandwidth/features and for far less than that web host. And,
looking at that site, I'm pretty sure DreamHost's personnel are also
more knowledgeable and technically adept than MicroOhio's.

On May 26, 11:25 am, nurvzy  wrote:
> http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables
>
> Look at App.baseUrl configuration.
>
> Hope that helps,
> Nick
>
> On May 26, 2:55 am, "Prof. No Time" 
> wrote:
>
> > Good day,
>
> > I need to install cakePHP on a server that does not support .htaccess
> > files:
> > (http://cp.micronet-ohio.com/psoft/servlet/psoft.hsphere.CP/oandoplc/
> > 223909_0/psoft.hsphere.CP?template_name=quick/quick_view.html)
>
> > 1. How do I go about this?
>
> > 2. What are the implications?
>
> > Thank you.

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


Auto relationship

2010-05-26 Thread Celso
How is the best way in cake?
This: ?



In database, i will put parent_id or categoria_id ???

Thanks,
Celso.

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: New install not finding Js files

2010-05-26 Thread Jules
Found the problem, my mac was messing up file permissions. Odd cakePHP
error though a 404 would have been more helpful.

On May 26, 2:19 pm, Julian Pickett 
wrote:
> Hi Nick
>
> Js files are in webroot/js
>
> Calling using the new: echo $this->Html->script(array('jquery.1.4.2'));
>
> When viewing source correct script tag entered: 
>
> Cheers
> Jules
>
> On 26 May 2010 04:22, nurvzy  wrote:
>
>
>
> > Hi Jules,
>
> >  Where are you storing your js files and how are you calling them?
>
> > Nick
>
> > On May 25, 1:49 pm, Jules  wrote:
> > > Installed CakePHP 1.3, all working fine css file being found but as
> > > soon as I try to add a js file I get a missing JsController error. I
> > > can't find any reason for this, mod_rewrite seems to be working or the
> > > css wouldn't be found.
>
> > > If anyone knows how to fix please help this error is driving me mad.
>
> > > 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 > 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: change action to render on beforeRender()

2010-05-26 Thread calvin
IMO, you should follow Cake conventions and use the callbacks the way
they're intended (and are named). If the callback is "beforeRender"
then obviously you wouldn't want to render from there. Just like if
you tried to force "beforeRender" code into "afterRender", you're
going to run into problems--and confuse other people who look at the
code.

The most obvious solution IMO, would be just to set a controller
property (e.g. $this->viewFile = $file_path), and then call
render($this->viewFile) at the end of each action. You could also
change $this->action to $file_path, but that may have other unintended
consequences. You can also disable autoRender and then do the
rendering in afterFilter(), but that's also breaking conventions and
confusing. Lastly, you could overload the render() function and just
replace it with the code you're putting in beforeRender(), using
parent::render() to call the original render function.

On May 26, 6:19 am, TuteC  wrote:
> Hi all. I'd like to change the default action to render so as to check
> if a customized one exists (so as to render page.eng.ctp instead of
> page.ctp. So, if that file exists, I want to render it on
> beforeRender(), like so:
>
>         function beforeRender() {
>                 $locale = $this->Session->read('Config.language');
>                 $file_path = VIEWS . $this->viewPath . DS . 
> $this->passedArgs[0] . ".
> $locale.ctp";
>                 if (file_exists($file_path)) {
>                         $this->render($file_path);
>                 }
>         }
>
> Te problem is that render() calls beforeRender, and I begin an
> infinite loop. Is there another way to replicate the behavior I want?
> If not, should we have a render() which doesn't call beforeRender
> (again), or an option so as to avoid it?
>
> My quick-and-dirty fix consisted in a duplicated render() function
> without that call, but I think a better fix would be great for
> CakePHP.
>
> Kind regards,
>
> Eugenio.

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: integrating SWF chart with cakephp

2010-05-26 Thread calvin
Yes. It will be possible. You would embed the flash the same as in any
other site, though you could probably create a helper to automate some
of the repetitive tasks.

On May 26, 9:06 am, Bryan Lim  wrote:
> Hi all,
>
> I want to integrate thishttp://www.maani.us/charts/index.phpinto my
> php application.
> Can someone give me a hint on how i can  go about doing it?
>
> There are javascript and swf element. Will it be possible?
>
> Thanks!
> /bryan

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: Server does not support .htaccess files

2010-05-26 Thread nurvzy
http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables

Look at App.baseUrl configuration.

Hope that helps,
Nick

On May 26, 2:55 am, "Prof. No Time" 
wrote:
> Good day,
>
> I need to install cakePHP on a server that does not support .htaccess
> files:
> (http://cp.micronet-ohio.com/psoft/servlet/psoft.hsphere.CP/oandoplc/
> 223909_0/psoft.hsphere.CP?template_name=quick/quick_view.html)
>
> 1. How do I go about this?
>
> 2. What are the implications?
>
> Thank you.

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: array of objects in the controller

2010-05-26 Thread sherzo

Thanks for your answer

The problem in I dont want to send the result to the view, i need to do some
process in the contorller.
something like :

$existingUsers = $this->userSubscriptions(24);
foreach($existingUsers as $existingUser):
$m = $m .$existingUser['UsersCity']['id'];
endforeach;

But im getting this erro: 
Warning (2): Invalid argument supplied for foreach()
[APP\controllers\users_cities_controller.php, line 172]

really dont know how to solve it!!!



calvin-38 wrote:
> 
> What exactly is the problem? If you know how to do that in the view,
> then you can do the same thing in the controller. There's nothing
> magical about passing find() results to the view using $this->set().
> All it does is "set" the variables you specify in the view. If you
> don't know the structure of $coupons, just use debug() to view it.
> 
> Also, technically those aren't objects, otherwise you'd access the
> 'title' property by $coupon->title; they're just associative arrays.
> 
> On May 26, 10:48 am, sherzo  wrote:
>> Hi all
>>
>> I need to have something like the following code but in the controller
>> not
>> view.
>> foreach ($coupons as $coupon)
>>         $st = $coupon['Coupon']['title'];
>> endforeach;
>>
>> and the $coupons is the result of a find() function.
>>
>> any idea?
>>
>> Thanks
>> Sherrt
>> --
>> View this message in
>> context:http://old.nabble.com/array-of-objects-in-the-controller-tp28684091p2...
>> Sent from the CakePHP mailing list archive at Nabble.com.
> 
> 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
> 
> 

-- 
View this message in context: 
http://old.nabble.com/array-of-objects-in-the-controller-tp28684091p28684491.html
Sent from the CakePHP mailing list archive at Nabble.com.

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: array of objects in the controller

2010-05-26 Thread calvin
What exactly is the problem? If you know how to do that in the view,
then you can do the same thing in the controller. There's nothing
magical about passing find() results to the view using $this->set().
All it does is "set" the variables you specify in the view. If you
don't know the structure of $coupons, just use debug() to view it.

Also, technically those aren't objects, otherwise you'd access the
'title' property by $coupon->title; they're just associative arrays.

On May 26, 10:48 am, sherzo  wrote:
> Hi all
>
> I need to have something like the following code but in the controller not
> view.
> foreach ($coupons as $coupon)
>         $st = $coupon['Coupon']['title'];
> endforeach;
>
> and the $coupons is the result of a find() function.
>
> any idea?
>
> Thanks
> Sherrt
> --
> View this message in 
> context:http://old.nabble.com/array-of-objects-in-the-controller-tp28684091p2...
> Sent from the CakePHP mailing list archive at Nabble.com.

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


array of objects in the controller

2010-05-26 Thread sherzo

Hi all

I need to have something like the following code but in the controller not
view.
foreach ($coupons as $coupon)
$st = $coupon['Coupon']['title'];
endforeach;


and the $coupons is the result of a find() function.


any idea?


Thanks
Sherrt
-- 
View this message in context: 
http://old.nabble.com/array-of-objects-in-the-controller-tp28684091p28684091.html
Sent from the CakePHP mailing list archive at Nabble.com.

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: hasOne with missing table + habtm

2010-05-26 Thread John Andersen
Ok, good that you solved it :)
   John

On May 26, 7:06 pm, Paolo  wrote:
> Hi, I managed to solve the issue by removing the whit from
> hasAndBelongsToMany.
>
> Thanks
>
> Paolo
>
[snip]

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: about Singleton instance

2010-05-26 Thread Miles J
Its a multiton instance.

http://en.wikipedia.org/wiki/Multiton_pattern

On May 26, 3:35 am, len  wrote:
> Hi All
>
> I have a question about Singleton instance.
>
> cake/libs/configure.php L133
>
> function&getInstance($boot = true) {
>      static $instance = array();
>          if (!$instance) {
>              $instance[0] =&  new Configure();
>              $instance[0]->__loadBootstrap($boot);
>          }
>      return $instance[0];
>
> }
>
> why type of $instance is array.
>
> Is the following ok?
>
> static $instance;
> if (!$instance) {
>      $instance =&  new Configure();
>
> }
>
> Thanks in advanced
>
> len

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


I18N problem with default language (FIXED)

2010-05-26 Thread massl
Hi,

I've noticed that the google bot indexed the language keys instead of
the translation. I could reproduce this by doing a telnet and a
"GET /" (it doesn't matter what site).

CakePHP caches the language files and for some reason it tried to load
"cake_core_default_en_us" instead of the default language. It didn't
matter if I chose "deu" or "eng" as default language - it always
loaded en_us. The bad thing is that Cake caches  [LC_MESSAGES]
[$my_default_language][default] as an empty array instead of trying to
load the correct language and so it doesn't translate.
The function I18n::translate() has this array in $_this->__domains.
For that reason it's not trying to translate it.

The problem could be "solved" by copying the cache file
"cake_core_default_$my_default_language" to "cake_core_default_en_us".
I could also "fix" it by changing the line "if (!isset($_this-
>__domains[$_this->category][$_this->__lang][$domain])) {" to "if (!
isset($_this->__domains[$_this->category][$_this->__lang][$domain]) ||
sizeof($_this->__domains[$_this->category][$_this->__lang][$domain] ==
0)) {".
So I have forced cake to re-read the language file if it doesn't
contain anything.

This happened with CakePHP 1.2.6 as well as 1.2.7.

But enough of this blah. The problem was, that I've used __() in
bootstrap.php - which was obviously bad, because Cake didn't know
anything about the default language *doh*. I don't think it's a real
bug, but it may be considered somewhere.


cheers,

massl

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: Header element not refreshing!!!

2010-05-26 Thread sherzo

Hi Paul

Thanks for your reply, Actually I solved the problem by setting variables
directly from the controller instead of using session.


Thanks
Sherry


WebbedIT wrote:
> 
> Seems a complicated implementation.  Can you show your code?
> especially the call to the header and the header itself.
> 
> Paul.
> 
> 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
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Header-element-not-refreshing%21%21%21-tp28654116p28683100.html
Sent from the CakePHP mailing list archive at Nabble.com.

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: [PHP-ES] rendimiento al editar archivos binarios

2010-05-26 Thread S Silva
Supongo que tendrás que posicionar el puntero del fichero al byte 640 con
http://php.net/manual/es/function.fseek.php
Y luego escribir normalmente con un fwrite.

if ( !file_exists($cache) || @$this->params['named']['cache'] === 0){
  $handle = fopen($filename, "r+b");
  fseek($handle, 640);
  fwrite($handle, $this->params['id'], 16);
  fclose($handle);
  FireCake::fb(" GENERADO (" . @$this->params['named']['cache'] . ")
$referer ($cache)");
}

Hace mucho que no hago estas cosas, puede que me equivoque pero tiene buena
pinta, no?

Te recomiendo que encapsules esto un poco más en vez que tirar directamente
de $this->params (estás dentro de un controlador???) y valides que todo
tiene el tamaño y la forma que debe. Si $this->params['id'] (que es un
parámetro por GET al fin y al cabo) tiene un valor raro puede corremper el
fichero.

Espero haber sido de ayuda.

Saludos.

El 26 de mayo de 2010 17:16, Manolet Gmail  escribió:

> Saludos, actualmente tengo una aplicacion que edita un archivo binario
> cambiando 16 bytes que estan en la misma posicion siempre (640 bytes
> despues
> del inicio del archivo), sin embargo lo que estoy haciendo es leer TODO el
> archivo para luego escribirlo usando la funcion pack, lo que siento que es
> bastante torpe y desconsiderado con la memoria ram (considerando que
> necesito hacer esto cientos de veces al instante). Este es el código que
> estoy utilizando.
>
>if ( !file_exists($cache) || @$this->params['named']['cache'] ===
> 0){
>$handle = fopen($filename, "r+b");
>$init = fread($handle, 640);
>  fread($handle, 16); //esto debe ser exactamente igual
> a lo que se reemplaza.
>$full= fread($handle, filesize($filename)); // leemos el
> resto para escribirlo despues
>fclose($handle);
>
>//las concateno para que sea human readable
>$contents = pack('a640'.'A16'.'a*', $init, $this->params['id'],
> $full);
>
>$handle = fopen($cache, "w+b");
>fwrite($handle, $contents);
>fclose($handle);
>FireCake::fb(" GENERADO ("@$this->params['named']['cache'].")
> $referer ($cache)");
>}
>
> Alguna idea de como hacerlo "mas eficiente"?
>
> Arnold
>

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: hasOne with missing table + habtm

2010-05-26 Thread Paolo
Hi, I managed to solve the issue by removing the whit from
hasAndBelongsToMany.

Thanks

Paolo

On May 26, 6:00 pm, John Andersen  wrote:
> Sorry Paolo, it is just, that when you specifies information that does
> not relate to each other, then it makes it very difficult to find out
> what your real issue is!
>
> The dump you posted I assume was not the result of a simple $this-
>
> >User->find('list'); - am I right?
>
> Try this - just because I didn't see it set anywhere - set recursive
> to 0 and do the find('list') and tell us what result you get.
> Enjoy,
>    John
>
> On May 26, 6:38 pm, Paolo  wrote:> The problem is not in a 
> specific find, I get the error when i do $this->User->find('list');
>
> > The model names and file names are correct and according to
> > conventions as usual.
>
> > Thanks
>
> [snip]

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


integrating SWF chart with cakephp

2010-05-26 Thread Bryan Lim
Hi all,

I want to integrate this http://www.maani.us/charts/index.php into my
php application.
Can someone give me a hint on how i can  go about doing it?

There are javascript and swf element. Will it be possible?


Thanks!
/bryan

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: hasOne with missing table + habtm

2010-05-26 Thread John Andersen
Sorry Paolo, it is just, that when you specifies information that does
not relate to each other, then it makes it very difficult to find out
what your real issue is!

The dump you posted I assume was not the result of a simple $this-
>User->find('list'); - am I right?

Try this - just because I didn't see it set anywhere - set recursive
to 0 and do the find('list') and tell us what result you get.
Enjoy,
   John

On May 26, 6:38 pm, Paolo  wrote:
> The problem is not in a specific find, I get the error when i do 
> $this->User->find('list');
>
> The model names and file names are correct and according to
> conventions as usual.
>
> Thanks
>
[snip]

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: hasOne with missing table + habtm

2010-05-26 Thread Paolo
The problem is not in a specific find, I get the error when i do $this-
>User->find('list');
The model names and file names are correct and according to
conventions as usual.

Thanks

On May 26, 5:23 pm, John Andersen  wrote:
> The associations seems to look fine to me!
>
> Please try to answer the rest of my questions in my previous post!
> Enjoy,
>    John
>
> On May 26, 5:03 pm, Paolo  wrote:
>
> > Hi, thanks for your answer. I show you the code of the models:
>
> > User:
>
> > class User extends AppModel {
>
> >         var $name = 'User';
>
> >         var $hasOne = array(
> >                 'Author' => array('className' => 'Author',
> >                                                         'foreignKey' => 
> > 'user_id',
> >                                                         'dependent' => false
> >                 ),
> >                 'Structure' => array('className' => 'Structure',
> >                                                         'foreignKey' => 
> > 'user_id',
> >                                                         'dependent' => false
> >                 )
> >         );
> > ?>
>
> >  > class Author extends AppModel {
>
> >         var $name = 'Author';
>
> >         var $belongsTo = array(
> >                                 'User' => array('className' => 'User',
> >                                                 'foreignKey' => 'user_id',
> >                                                 'conditions' => '',
> >                                                 'fields' => '',
> >                                                 'order' => ''
> >                                 )
> >         );
>
> >         var $hasAndBelongsToMany = array(
> >                         'Game' => array(
> >                                 'className' => 'Game',
> >                                 'joinTable' => 'games_authors',
> >                                 'associationForeignKey' => 'game_id',
> >                                 'foreignKey' => 'author_id',
> >                                 'with' => 'GamesAuthor'
> >                         )
> >         );}
>
> > ?>
>
> > On May 26, 3:57 pm, John Andersen  wrote:
>
> > > Thank you!
>
> > > How does your find statement look like? Please show the code.
>
> > > How is your association between User and Author defined? Please show
> > > the code.
>
> > > How is your association between Author and the other model defined?
> > > Please show the code.
>
> > > The dump didn't give me any clue at all.
>
> > > Are your names in accordance with the CakePHP conventions?
> > > Model names is camelcased, model filenames are lowercase and
> > > underscored!
>
> > > Enjoy,
> > >    John
>
> > > On May 26, 4:37 pm, Paolo  wrote:
>
> > > > I've put pr (debug_backtrace()); die; in the function
> > > > ConnectionManager::getDataSource, it seems like the name parameter is
> > > > an empty string.
>
> > > > The error I get is:
>
> > > > Notice (8): Trying to get property of non-object [CORE/cake/libs/model/
> > > > datasources/dbo_source.php, line 673]
>
> > > > Code | Context
>
> > > > $this   =       DboMysql
> > > > DboMysql::$description = "MySQL DBO Driver"
> > > > DboMysql::$_baseConfig = array
> > > > DboMysql::$startQuote = "`"
> > > > DboMysql::$endQuote = "`"
> > > > DboMysql::$_useAlias = true
> > > > DboMysql::$_commands = array
> > > > DboMysql::$columns = array
> > > > DboMysql::$index = array
> > > > DboMysql::$alias = "AS "
> > > > DboMysql::$fieldCache = array
> > > > DboMysql::$__bypass = false
> > > > DboMysql::$__sqlOps = array
> > > > DboMysql::$connected = true
> > > > DboMysql::$fullDebug = false
> > > > DboMysql::$error = NULL
> > > > DboMysql::$affected = 1
> > > > DboMysql::$numRows = 1
> > > > DboMysql::$took = 0
> > > > DboMysql::$_result = resource
> > > > DboMysql::$_queriesCnt = 0
> > > > DboMysql::$_queriesTime = NULL
> > > > DboMysql::$_queriesLog = array
> > > > DboMysql::$_queriesLogMax = 200
> > > > DboMysql::$_queryCache = array
> > > > DboMysql::$__descriptions = array
> > > > DboMysql::$_sources = array
> > > > DboMysql::$connection = resource
> > > > DboMysql::$config = array
> > > > DboMysql::$configKeyName = "default"
> > > > DboMysql::$_transactionStarted = false
> > > > DboMysql::$cacheSources = true
> > > > DboMysql::$_log = NULL
> > > > DboMysql::$results = resource
> > > > DboMysql::$map = array
> > > > DboMysql::$__booleans = array
> > > > $model  =       User
> > > > User::$name = "User"
> > > > User::$validate = array
> > > > User::$hasOne = array
> > > > User::$hasMany = array
> > > > User::$useDbConfig = "default"
> > > > User::$useTable = "users"
> > > > User::$displayField = "name"
> > > > User::$id = false
> > > > User::$data = array
> > > > User::$table = "users"
> > > > User::$primaryKey = "id"
> > > > User::$_schema = array
> > > > User::$validationErrors = array
> > > > User::$tablePrefix = ""
> > > > User::$alias = "User"
> > > > User::$tableToModel = array
> > > > User::$logTransactions = f

Re: hasOne with missing table + habtm

2010-05-26 Thread John Andersen
The associations seems to look fine to me!

Please try to answer the rest of my questions in my previous post!
Enjoy,
   John

On May 26, 5:03 pm, Paolo  wrote:
> Hi, thanks for your answer. I show you the code of the models:
>
> User:
>
> class User extends AppModel {
>
>         var $name = 'User';
>
>         var $hasOne = array(
>                 'Author' => array('className' => 'Author',
>                                                         'foreignKey' => 
> 'user_id',
>                                                         'dependent' => false
>                 ),
>                 'Structure' => array('className' => 'Structure',
>                                                         'foreignKey' => 
> 'user_id',
>                                                         'dependent' => false
>                 )
>         );
> ?>
>
>  class Author extends AppModel {
>
>         var $name = 'Author';
>
>         var $belongsTo = array(
>                                 'User' => array('className' => 'User',
>                                                 'foreignKey' => 'user_id',
>                                                 'conditions' => '',
>                                                 'fields' => '',
>                                                 'order' => ''
>                                 )
>         );
>
>         var $hasAndBelongsToMany = array(
>                         'Game' => array(
>                                 'className' => 'Game',
>                                 'joinTable' => 'games_authors',
>                                 'associationForeignKey' => 'game_id',
>                                 'foreignKey' => 'author_id',
>                                 'with' => 'GamesAuthor'
>                         )
>         );}
>
> ?>
>
> On May 26, 3:57 pm, John Andersen  wrote:
>
> > Thank you!
>
> > How does your find statement look like? Please show the code.
>
> > How is your association between User and Author defined? Please show
> > the code.
>
> > How is your association between Author and the other model defined?
> > Please show the code.
>
> > The dump didn't give me any clue at all.
>
> > Are your names in accordance with the CakePHP conventions?
> > Model names is camelcased, model filenames are lowercase and
> > underscored!
>
> > Enjoy,
> >    John
>
> > On May 26, 4:37 pm, Paolo  wrote:
>
> > > I've put pr (debug_backtrace()); die; in the function
> > > ConnectionManager::getDataSource, it seems like the name parameter is
> > > an empty string.
>
> > > The error I get is:
>
> > > Notice (8): Trying to get property of non-object [CORE/cake/libs/model/
> > > datasources/dbo_source.php, line 673]
>
> > > Code | Context
>
> > > $this   =       DboMysql
> > > DboMysql::$description = "MySQL DBO Driver"
> > > DboMysql::$_baseConfig = array
> > > DboMysql::$startQuote = "`"
> > > DboMysql::$endQuote = "`"
> > > DboMysql::$_useAlias = true
> > > DboMysql::$_commands = array
> > > DboMysql::$columns = array
> > > DboMysql::$index = array
> > > DboMysql::$alias = "AS "
> > > DboMysql::$fieldCache = array
> > > DboMysql::$__bypass = false
> > > DboMysql::$__sqlOps = array
> > > DboMysql::$connected = true
> > > DboMysql::$fullDebug = false
> > > DboMysql::$error = NULL
> > > DboMysql::$affected = 1
> > > DboMysql::$numRows = 1
> > > DboMysql::$took = 0
> > > DboMysql::$_result = resource
> > > DboMysql::$_queriesCnt = 0
> > > DboMysql::$_queriesTime = NULL
> > > DboMysql::$_queriesLog = array
> > > DboMysql::$_queriesLogMax = 200
> > > DboMysql::$_queryCache = array
> > > DboMysql::$__descriptions = array
> > > DboMysql::$_sources = array
> > > DboMysql::$connection = resource
> > > DboMysql::$config = array
> > > DboMysql::$configKeyName = "default"
> > > DboMysql::$_transactionStarted = false
> > > DboMysql::$cacheSources = true
> > > DboMysql::$_log = NULL
> > > DboMysql::$results = resource
> > > DboMysql::$map = array
> > > DboMysql::$__booleans = array
> > > $model  =       User
> > > User::$name = "User"
> > > User::$validate = array
> > > User::$hasOne = array
> > > User::$hasMany = array
> > > User::$useDbConfig = "default"
> > > User::$useTable = "users"
> > > User::$displayField = "name"
> > > User::$id = false
> > > User::$data = array
> > > User::$table = "users"
> > > User::$primaryKey = "id"
> > > User::$_schema = array
> > > User::$validationErrors = array
> > > User::$tablePrefix = ""
> > > User::$alias = "User"
> > > User::$tableToModel = array
> > > User::$logTransactions = false
> > > User::$transactional = false
> > > User::$cacheQueries = false
> > > User::$belongsTo = array
> > > User::$hasAndBelongsToMany = array
> > > User::$actsAs = NULL
> > > User::$Behaviors = BehaviorCollection object
> > > User::$whitelist = array
> > > User::$cacheSources = true
> > > User::$findQueryType = "first"
> > > User::$recursive = 1
> > > User::$order = NULL
> > > User::$__exists = NULL
> > > User::$__associationKeys = array
> > > User::$__assoc

rendimiento al editar archivos binarios

2010-05-26 Thread Manolet Gmail
Saludos, la pregunta que hare aqui no esta necesariamente relacionada con
cake, pero cometo el pecado de hacerla en la lista por si alguien sabe como
ayudarme, pues estoy usando cakephp en el proyecto.

Actualmente tengo una aplicacion que edita un archivo binario cambiando 16
bytes que estan en la misma posicion siempre (640 bytes despues del inicio
del archivo), sin embargo lo que estoy haciendo es leer TODO el archivo para
luego escribirlo usando la funcion pack, lo que siento que es bastante torpe
y desconsiderado con la memoria ram (considerando que necesito hacer esto
cientos de veces al instante). Este es el código que estoy utilizando:

if ( !file_exists($cache) || @$this->params['named']['cache'] ===
0){
$handle = fopen($filename, "r+b");
$init = fread($handle, 640);
  fread($handle, 16); //esto debe ser exactamente igual
a lo que se reemplaza.
$full= fread($handle, filesize($filename)); // leemos el
resto para escribirlo despues
fclose($handle);

//las concateno para que sea human readable
$contents = pack('a640'.'A16'.'a*', $init, $this->params['id'],
$full);

$handle = fopen($cache, "w+b");
fwrite($handle, $contents);
fclose($handle);
FireCake::fb(" GENERADO ("@$this->params['named']['cache'].")
$referer ($cache)");
}

Alguna idea de como hacerlo "mas eficiente"? ¿puedo editarlo sin necesidad
de cargar todo el archivo en memoria?

Arnold

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


about Singleton instance

2010-05-26 Thread len

Hi All

I have a question about Singleton instance.

cake/libs/configure.php L133

function&getInstance($boot = true) {
static $instance = array();
if (!$instance) {
$instance[0] =&  new Configure();
$instance[0]->__loadBootstrap($boot);
}
return $instance[0];
}

why type of $instance is array.

Is the following ok?

static $instance;
if (!$instance) {
$instance =&  new Configure();
}


Thanks in advanced

len


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


cakephp and db2

2010-05-26 Thread leon
CakePHP will add two single quotes for integer in SQL string, but
execute this kind of sql will cause error in db2.

Wrong Sql string SELECT * FROM posts WHERE id = '1';
Right Sql string SELECT * FROM posts WHERE id = 1;

note:id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY

anybody know this problem, pls help me ,Thanks in advance.

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: 404 error since updating to 1.3

2010-05-26 Thread Ernesto
are you guys using SecurityComponent?

On 26 Mag, 16:05, Ernesto  wrote:
> same problem here.
>
> rolled back to RC4 :)
>
> On 26 Mag, 12:24, Ed Propsner  wrote:
>
>
>
> > I just updated to 1.3 stable from RC4 yesterday and I've been having the
> > same exact problem (amongst a few others) ever since.
>
> > I have to toy with it some more but it seems to only happen when passing
> > data into the controller action. As soon as the action sees $this->data
> > it dies. Even debug($this->data) causes it to fail.
>
> > I'm still toying with it and I'll re-post if I come up with anything worth
> > while. In the meantime it would be great to know if anyone had the same
> > problem and how they resolved it 8-)
>
> > - Ed
>
> > On Wed, May 26, 2010 at 5:21 AM, Taff  wrote:
> > > Hi,
> > > since updating my app to 1.3, one of my controllers is throwing a 404.
> > > All the other controllers/methods are working properly. I took a look
> > > at the controller and it's all the initial add edit delete view
> > > methods created during baking. Where should I start looking for the
> > > error, as I'm at a loss.
>
> > > Debugging is turned on but I'm still getting the 404 with no debugging
> > > information. The error is "The requested URL /app/webroot/webcasts/
> > > index/language:deu was not found on this server." Any help would be
> > > greatly appreciated.
>
> > > Cheers,
> > > Taff
>
> > > 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.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: 404 error since updating to 1.3

2010-05-26 Thread Ernesto
same problem here.

rolled back to RC4 :)

On 26 Mag, 12:24, Ed Propsner  wrote:
> I just updated to 1.3 stable from RC4 yesterday and I've been having the
> same exact problem (amongst a few others) ever since.
>
> I have to toy with it some more but it seems to only happen when passing
> data into the controller action. As soon as the action sees $this->data
> it dies. Even debug($this->data) causes it to fail.
>
> I'm still toying with it and I'll re-post if I come up with anything worth
> while. In the meantime it would be great to know if anyone had the same
> problem and how they resolved it 8-)
>
> - Ed
>
>
>
> On Wed, May 26, 2010 at 5:21 AM, Taff  wrote:
> > Hi,
> > since updating my app to 1.3, one of my controllers is throwing a 404.
> > All the other controllers/methods are working properly. I took a look
> > at the controller and it's all the initial add edit delete view
> > methods created during baking. Where should I start looking for the
> > error, as I'm at a loss.
>
> > Debugging is turned on but I'm still getting the 404 with no debugging
> > information. The error is "The requested URL /app/webroot/webcasts/
> > index/language:deu was not found on this server." Any help would be
> > greatly appreciated.
>
> > Cheers,
> > Taff
>
> > 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: hasOne with missing table + habtm

2010-05-26 Thread Paolo
Hi, thanks for your answer. I show you the code of the models:

User:

class User extends AppModel {

var $name = 'User';

var $hasOne = array(
'Author' => array('className' => 'Author',
'foreignKey' => 
'user_id',
'dependent' => false
),
'Structure' => array('className' => 'Structure',
'foreignKey' => 
'user_id',
'dependent' => false
)
);
?>

 array('className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

var $hasAndBelongsToMany = array(
'Game' => array(
'className' => 'Game',
'joinTable' => 'games_authors',
'associationForeignKey' => 'game_id',
'foreignKey' => 'author_id',
'with' => 'GamesAuthor'
)
);
}
?>

On May 26, 3:57 pm, John Andersen  wrote:
> Thank you!
>
> How does your find statement look like? Please show the code.
>
> How is your association between User and Author defined? Please show
> the code.
>
> How is your association between Author and the other model defined?
> Please show the code.
>
> The dump didn't give me any clue at all.
>
> Are your names in accordance with the CakePHP conventions?
> Model names is camelcased, model filenames are lowercase and
> underscored!
>
> Enjoy,
>    John
>
> On May 26, 4:37 pm, Paolo  wrote:
>
> > I've put pr (debug_backtrace()); die; in the function
> > ConnectionManager::getDataSource, it seems like the name parameter is
> > an empty string.
>
> > The error I get is:
>
> > Notice (8): Trying to get property of non-object [CORE/cake/libs/model/
> > datasources/dbo_source.php, line 673]
>
> > Code | Context
>
> > $this   =       DboMysql
> > DboMysql::$description = "MySQL DBO Driver"
> > DboMysql::$_baseConfig = array
> > DboMysql::$startQuote = "`"
> > DboMysql::$endQuote = "`"
> > DboMysql::$_useAlias = true
> > DboMysql::$_commands = array
> > DboMysql::$columns = array
> > DboMysql::$index = array
> > DboMysql::$alias = "AS "
> > DboMysql::$fieldCache = array
> > DboMysql::$__bypass = false
> > DboMysql::$__sqlOps = array
> > DboMysql::$connected = true
> > DboMysql::$fullDebug = false
> > DboMysql::$error = NULL
> > DboMysql::$affected = 1
> > DboMysql::$numRows = 1
> > DboMysql::$took = 0
> > DboMysql::$_result = resource
> > DboMysql::$_queriesCnt = 0
> > DboMysql::$_queriesTime = NULL
> > DboMysql::$_queriesLog = array
> > DboMysql::$_queriesLogMax = 200
> > DboMysql::$_queryCache = array
> > DboMysql::$__descriptions = array
> > DboMysql::$_sources = array
> > DboMysql::$connection = resource
> > DboMysql::$config = array
> > DboMysql::$configKeyName = "default"
> > DboMysql::$_transactionStarted = false
> > DboMysql::$cacheSources = true
> > DboMysql::$_log = NULL
> > DboMysql::$results = resource
> > DboMysql::$map = array
> > DboMysql::$__booleans = array
> > $model  =       User
> > User::$name = "User"
> > User::$validate = array
> > User::$hasOne = array
> > User::$hasMany = array
> > User::$useDbConfig = "default"
> > User::$useTable = "users"
> > User::$displayField = "name"
> > User::$id = false
> > User::$data = array
> > User::$table = "users"
> > User::$primaryKey = "id"
> > User::$_schema = array
> > User::$validationErrors = array
> > User::$tablePrefix = ""
> > User::$alias = "User"
> > User::$tableToModel = array
> > User::$logTransactions = false
> > User::$transactional = false
> > User::$cacheQueries = false
> > User::$belongsTo = array
> > User::$hasAndBelongsToMany = array
> > User::$actsAs = NULL
> > User::$Behaviors = BehaviorCollection object
> > User::$whitelist = array
> > User::$cacheSources = true
> > User::$findQueryType = "first"
> > User::$recursive = 1
> > User::$order = NULL
> > User::$__exists = NULL
> > User::$__associationKeys = array
> > User::$__associations = array
> > User::$__backAssociation = array
> > User::$__insertID = NULL
> > User::$__numRows = NULL
> > User::$__affectedRows = NULL
> > User::$_findMethods = array
> > User::$_log = NULL
> > User::$Structure = Structure object
> > User::$Author = NULL
> > $queryData      =       array(
> >         "conditions" => array(
> >         "User.id" => "178"
> > ),
> >         "fields" => array(
> >         "`User`.`id`",
> >         "`User`.`name`",
> >         "`User`.`surname`",
> >         "`User`.`username`",
> >         "`User`.`password`",
> >    

Re: hasOne with missing table + habtm

2010-05-26 Thread John Andersen
Thank you!

How does your find statement look like? Please show the code.

How is your association between User and Author defined? Please show
the code.

How is your association between Author and the other model defined?
Please show the code.

The dump didn't give me any clue at all.

Are your names in accordance with the CakePHP conventions?
Model names is camelcased, model filenames are lowercase and
underscored!

Enjoy,
   John

On May 26, 4:37 pm, Paolo  wrote:
> I've put pr (debug_backtrace()); die; in the function
> ConnectionManager::getDataSource, it seems like the name parameter is
> an empty string.
>
> The error I get is:
>
> Notice (8): Trying to get property of non-object [CORE/cake/libs/model/
> datasources/dbo_source.php, line 673]
>
> Code | Context
>
> $this   =       DboMysql
> DboMysql::$description = "MySQL DBO Driver"
> DboMysql::$_baseConfig = array
> DboMysql::$startQuote = "`"
> DboMysql::$endQuote = "`"
> DboMysql::$_useAlias = true
> DboMysql::$_commands = array
> DboMysql::$columns = array
> DboMysql::$index = array
> DboMysql::$alias = "AS "
> DboMysql::$fieldCache = array
> DboMysql::$__bypass = false
> DboMysql::$__sqlOps = array
> DboMysql::$connected = true
> DboMysql::$fullDebug = false
> DboMysql::$error = NULL
> DboMysql::$affected = 1
> DboMysql::$numRows = 1
> DboMysql::$took = 0
> DboMysql::$_result = resource
> DboMysql::$_queriesCnt = 0
> DboMysql::$_queriesTime = NULL
> DboMysql::$_queriesLog = array
> DboMysql::$_queriesLogMax = 200
> DboMysql::$_queryCache = array
> DboMysql::$__descriptions = array
> DboMysql::$_sources = array
> DboMysql::$connection = resource
> DboMysql::$config = array
> DboMysql::$configKeyName = "default"
> DboMysql::$_transactionStarted = false
> DboMysql::$cacheSources = true
> DboMysql::$_log = NULL
> DboMysql::$results = resource
> DboMysql::$map = array
> DboMysql::$__booleans = array
> $model  =       User
> User::$name = "User"
> User::$validate = array
> User::$hasOne = array
> User::$hasMany = array
> User::$useDbConfig = "default"
> User::$useTable = "users"
> User::$displayField = "name"
> User::$id = false
> User::$data = array
> User::$table = "users"
> User::$primaryKey = "id"
> User::$_schema = array
> User::$validationErrors = array
> User::$tablePrefix = ""
> User::$alias = "User"
> User::$tableToModel = array
> User::$logTransactions = false
> User::$transactional = false
> User::$cacheQueries = false
> User::$belongsTo = array
> User::$hasAndBelongsToMany = array
> User::$actsAs = NULL
> User::$Behaviors = BehaviorCollection object
> User::$whitelist = array
> User::$cacheSources = true
> User::$findQueryType = "first"
> User::$recursive = 1
> User::$order = NULL
> User::$__exists = NULL
> User::$__associationKeys = array
> User::$__associations = array
> User::$__backAssociation = array
> User::$__insertID = NULL
> User::$__numRows = NULL
> User::$__affectedRows = NULL
> User::$_findMethods = array
> User::$_log = NULL
> User::$Structure = Structure object
> User::$Author = NULL
> $queryData      =       array(
>         "conditions" => array(
>         "User.id" => "178"
> ),
>         "fields" => array(
>         "`User`.`id`",
>         "`User`.`name`",
>         "`User`.`surname`",
>         "`User`.`username`",
>         "`User`.`password`",
>         "`User`.`email`"
> ),
>         "joins" => array(
>         array()
> ),
>         "limit" => 1,
>         "offset" => array(),
>         "order" => array(
>         null
> ),
>         "page" => 1,
>         "group" => array(),
>         "callbacks" => true
> )
> $recursive      =       null
> $null   =       null
> $array  =       array()
> $linkedModels   =       array(
>         "hasOne/Author" => true
> )
> $_associations  =       array(
>         "belongsTo",
>         "hasOne",
>         "hasMany",
>         "hasAndBelongsToMany"
> )
> $type   =       "hasOne"
> $assocData      =       array(
>         "className" => "Author",
>         "foreignKey" => "user_id",
>         "dependent" => false,
>         "conditions" => "",
>         "fields" => "",
>         "order" => "",
>         "limit" => "",
>         "offset" => "",
>         "exclusive" => "",
>         "finderQuery" => "",
>         "counterQuery" => ""
> )
> $assoc  =       "Author"
> $linkModel      =       null
> $external       =       false
> $query  =       "SELECT `User`.`id`, `User`.`name`, `User`.`surname`,
> `User`.`username`, `User`.`password`, `User`.`email`,
> `User`.`user_ip`, `User`.`isAdmin` FROM `users` AS `User`  WHERE
> `User`.`id` = 178    LIMIT 1"
> $resultSet      =       array(
>         array(
>         "User" => array(),
>         "Author" => array()
> )
> )
> $filtered       =       array(
>         "Structure"
> )
>
>                             $db =& $this;
>                         } else {
>                             $db =&
> ConnectionManager::getDataSource($linkModel->useDbConfig);
>
> DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php,
> line 673
>

Re: hasOne with missing table + habtm

2010-05-26 Thread Paolo
I've put pr (debug_backtrace()); die; in the function
ConnectionManager::getDataSource, it seems like the name parameter is
an empty string.

The error I get is:

Notice (8): Trying to get property of non-object [CORE/cake/libs/model/
datasources/dbo_source.php, line 673]

Code | Context

$this   =   DboMysql
DboMysql::$description = "MySQL DBO Driver"
DboMysql::$_baseConfig = array
DboMysql::$startQuote = "`"
DboMysql::$endQuote = "`"
DboMysql::$_useAlias = true
DboMysql::$_commands = array
DboMysql::$columns = array
DboMysql::$index = array
DboMysql::$alias = "AS "
DboMysql::$fieldCache = array
DboMysql::$__bypass = false
DboMysql::$__sqlOps = array
DboMysql::$connected = true
DboMysql::$fullDebug = false
DboMysql::$error = NULL
DboMysql::$affected = 1
DboMysql::$numRows = 1
DboMysql::$took = 0
DboMysql::$_result = resource
DboMysql::$_queriesCnt = 0
DboMysql::$_queriesTime = NULL
DboMysql::$_queriesLog = array
DboMysql::$_queriesLogMax = 200
DboMysql::$_queryCache = array
DboMysql::$__descriptions = array
DboMysql::$_sources = array
DboMysql::$connection = resource
DboMysql::$config = array
DboMysql::$configKeyName = "default"
DboMysql::$_transactionStarted = false
DboMysql::$cacheSources = true
DboMysql::$_log = NULL
DboMysql::$results = resource
DboMysql::$map = array
DboMysql::$__booleans = array
$model  =   User
User::$name = "User"
User::$validate = array
User::$hasOne = array
User::$hasMany = array
User::$useDbConfig = "default"
User::$useTable = "users"
User::$displayField = "name"
User::$id = false
User::$data = array
User::$table = "users"
User::$primaryKey = "id"
User::$_schema = array
User::$validationErrors = array
User::$tablePrefix = ""
User::$alias = "User"
User::$tableToModel = array
User::$logTransactions = false
User::$transactional = false
User::$cacheQueries = false
User::$belongsTo = array
User::$hasAndBelongsToMany = array
User::$actsAs = NULL
User::$Behaviors = BehaviorCollection object
User::$whitelist = array
User::$cacheSources = true
User::$findQueryType = "first"
User::$recursive = 1
User::$order = NULL
User::$__exists = NULL
User::$__associationKeys = array
User::$__associations = array
User::$__backAssociation = array
User::$__insertID = NULL
User::$__numRows = NULL
User::$__affectedRows = NULL
User::$_findMethods = array
User::$_log = NULL
User::$Structure = Structure object
User::$Author = NULL
$queryData  =   array(
"conditions" => array(
"User.id" => "178"
),
"fields" => array(
"`User`.`id`",
"`User`.`name`",
"`User`.`surname`",
"`User`.`username`",
"`User`.`password`",
"`User`.`email`"
),
"joins" => array(
array()
),
"limit" => 1,
"offset" => array(),
"order" => array(
null
),
"page" => 1,
"group" => array(),
"callbacks" => true
)
$recursive  =   null
$null   =   null
$array  =   array()
$linkedModels   =   array(
"hasOne/Author" => true
)
$_associations  =   array(
"belongsTo",
"hasOne",
"hasMany",
"hasAndBelongsToMany"
)
$type   =   "hasOne"
$assocData  =   array(
"className" => "Author",
"foreignKey" => "user_id",
"dependent" => false,
"conditions" => "",
"fields" => "",
"order" => "",
"limit" => "",
"offset" => "",
"exclusive" => "",
"finderQuery" => "",
"counterQuery" => ""
)
$assoc  =   "Author"
$linkModel  =   null
$external   =   false
$query  =   "SELECT `User`.`id`, `User`.`name`, `User`.`surname`,
`User`.`username`, `User`.`password`, `User`.`email`,
`User`.`user_ip`, `User`.`isAdmin` FROM `users` AS `User`  WHERE
`User`.`id` = 178LIMIT 1"
$resultSet  =   array(
array(
"User" => array(),
"Author" => array()
)
)
$filtered   =   array(
"Structure"
)

$db =& $this;
} else {
$db =&
ConnectionManager::getDataSource($linkModel->useDbConfig);

DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php,
line 673
Model::find() - CORE/cake/libs/model/model.php, line 2031
AppController::beforeRender() - APP/app_controller.php, line 107
Controller::render() - CORE/cake/libs/controller/controller.php, line
763
ErrorHandler::_outputMessage() - CORE/cake/libs/error.php, line 373
ErrorHandler::missingTable() - CORE/cake/libs/error.php, line 224
Object::dispatchMethod() - CORE/cake/libs/object.php, line 118
ErrorHandler::__construct() - CORE/cake/libs/error.php, line 118
Object::cakeError() - CORE/cake/libs/object.php, line 203
Model::setSource() - CORE/cake/libs/model/model.php, line 779
Model::__construct() - CORE/cake/libs/model/model.php, line 439
ClassRegistry::init() - CORE/cake/libs/class_registry.php, line 148
Model::__constructLinkedModel() - CORE/cake/libs/model/model.php, line
666
Mod

Re: New install not finding Js files

2010-05-26 Thread Julian Pickett
Hi Nick

Js files are in webroot/js

Calling using the new: echo $this->Html->script(array('jquery.1.4.2'));

When viewing source correct script tag entered: 

Cheers
Jules

On 26 May 2010 04:22, nurvzy  wrote:

> Hi Jules,
>
>  Where are you storing your js files and how are you calling them?
>
> Nick
>
> On May 25, 1:49 pm, Jules  wrote:
> > Installed CakePHP 1.3, all working fine css file being found but as
> > soon as I try to add a js file I get a missing JsController error. I
> > can't find any reason for this, mod_rewrite seems to be working or the
> > css wouldn't be found.
> >
> > If anyone knows how to fix please help this error is driving me mad.
> >
> > 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.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


change action to render on beforeRender()

2010-05-26 Thread TuteC
Hi all. I'd like to change the default action to render so as to check
if a customized one exists (so as to render page.eng.ctp instead of
page.ctp. So, if that file exists, I want to render it on
beforeRender(), like so:

function beforeRender() {
$locale = $this->Session->read('Config.language');
$file_path = VIEWS . $this->viewPath . DS . 
$this->passedArgs[0] . ".
$locale.ctp";
if (file_exists($file_path)) {
$this->render($file_path);
}
}

Te problem is that render() calls beforeRender, and I begin an
infinite loop. Is there another way to replicate the behavior I want?
If not, should we have a render() which doesn't call beforeRender
(again), or an option so as to avoid it?

My quick-and-dirty fix consisted in a duplicated render() function
without that call, but I think a better fix would be great for
CakePHP.

Kind regards,

Eugenio.

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: isset function for different buttons in one page.

2010-05-26 Thread John Andersen
Ok, fine, but is your issue then solved??
   John

On May 26, 2:51 pm, "Master Ram...!"  wrote:
> ya. my upper buttons are inside the form only...
>
> sir
>
[snip]

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: isset function for different buttons in one page.

2010-05-26 Thread Master Ram...!
ya. my upper buttons are inside the form only...

sir





On Wed, May 26, 2010 at 5:12 PM, John Andersen wrote:

> Please confirm that your upper buttons are inside the form tags in
> your html - take a look at the source code in your browser!
>
> If that doesn't give you a clue to the issue, please show the view
> code for the form.
> Enjoy,
>John
>
> On May 26, 2:36 pm, Master Ram  wrote:
> > hi.. to all
> >
> > i have 8 submit button in one form.
> >
> > this is the example:
> >
> > 
> >  
> > some functions and text fields.
> >
> > i  want to do all the operations.
> >
> > again the same buttons with the same action i have to do.
> >
> > 
> > 
> >
> > i used the isset function. still it is having problem.
> >
> > suggest me if any other ways to salve the problem.
> >
> > for bellow buttons are working fine. but upper battens are not
> > working.
> >
> > how to solve this problem.
>
> 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: isset function for different buttons in one page.

2010-05-26 Thread John Andersen
Please confirm that your upper buttons are inside the form tags in
your html - take a look at the source code in your browser!

If that doesn't give you a clue to the issue, please show the view
code for the form.
Enjoy,
   John

On May 26, 2:36 pm, Master Ram  wrote:
> hi.. to all
>
> i have 8 submit button in one form.
>
> this is the example:
>
> 
>          
> some functions and text fields.
>
> i  want to do all the operations.
>
> again the same buttons with the same action i have to do.
>
> 
> 
>
> i used the isset function. still it is having problem.
>
> suggest me if any other ways to salve the problem.
>
> for bellow buttons are working fine. but upper battens are not
> working.
>
> how to solve this problem.

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: isset function for different buttons in one page.

2010-05-26 Thread Jeremy Burns
Check $this->params['form'] - the name of the button you click should be in 
there.

Jeremy Burns
jeremybu...@me.com


On 26 May 2010, at 12:36, Master Ram wrote:

> hi.. to all
> 
> 
> i have 8 submit button in one form.
> 
> this is the example:
> 
> 
> 
> some functions and text fields.
> 
> i  want to do all the operations.
> 
> again the same buttons with the same action i have to do.
> 
> 
> 
> 
> 
> i used the isset function. still it is having problem.
> 
> suggest me if any other ways to salve the problem.
> 
> for bellow buttons are working fine. but upper battens are not
> working.
> 
> how to solve this problem.
> 
> 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: hasOne with missing table + habtm

2010-05-26 Thread John Andersen
Please provide full information on your issue :)

What error message are you receiving?
How does your find statement look like?
Do you use the Containable behaviour?

Then maybe we will better be able to assist you in solving your
issue :)
Enjoy,
   John

On May 26, 1:39 pm, Paolo  wrote:
> PS: I talked about the habtm relationship because if i remove that
> relation everything works well.
>
> On May 26, 12:37 pm, Paolo  wrote:
>
> > Hi all, I have a problem in a project I'm working on. I have a table
> > Users with two hasOne relationships with  Author and Manager. The
> > Author table has a htbm relation with another table. The problem I'm
> > facing is that when querying on the users table, if there is no
> > related author (an acceptable  scenario in my case), cakes returns an
> > error, specifically in the connection_manager -> getDataSource
> > function. Do you know how can I avoid this error?
> > I'm usign cake 1.2.6.
>
> > 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


isset function for different buttons in one page.

2010-05-26 Thread Master Ram
hi.. to all


i have 8 submit button in one form.

this is the example:


 
some functions and text fields.

i  want to do all the operations.

again the same buttons with the same action i have to do.





i used the isset function. still it is having problem.

suggest me if any other ways to salve the problem.

for bellow buttons are working fine. but upper battens are not
working.

how to solve this problem.

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: hasOne with missing table + habtm

2010-05-26 Thread Paolo
PS: I talked about the habtm relationship because if i remove that
relation everything works well.

On May 26, 12:37 pm, Paolo  wrote:
> Hi all, I have a problem in a project I'm working on. I have a table
> Users with two hasOne relationships with  Author and Manager. The
> Author table has a htbm relation with another table. The problem I'm
> facing is that when querying on the users table, if there is no
> related author (an acceptable  scenario in my case), cakes returns an
> error, specifically in the connection_manager -> getDataSource
> function. Do you know how can I avoid this error?
> I'm usign cake 1.2.6.
>
> 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


hasOne with missing table + habtm

2010-05-26 Thread Paolo
Hi all, I have a problem in a project I'm working on. I have a table
Users with two hasOne relationships with  Author and Manager. The
Author table has a htbm relation with another table. The problem I'm
facing is that when querying on the users table, if there is no
related author (an acceptable  scenario in my case), cakes returns an
error, specifically in the connection_manager -> getDataSource
function. Do you know how can I avoid this error?
I'm usign cake 1.2.6.

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: how i apply css on $html->link

2010-05-26 Thread Ed Propsner
John is correct, I've used it both ways  I'm just a bit partial to
divs.

I've also defined css rules inline using 'style' =>  but I rarely use that
method.

- Ed

On Wed, May 26, 2010 at 5:12 AM, John Andersen wrote:

> As written in the CakePHP book at:
>
> http://book.cakephp.org/view/1435/Inserting-Well-Formatted-elements#link-1442
>
> then what you have shown in your post is correct!
> Now you just need to define your "current" style in your CSS file and
> you are good to go!
> Enjoy,
>   John
>
> On May 26, 9:41 am, Dilip Godhani  wrote:
> > Can any One hellp
> >
> > How i Apply css in $html->link
> > i give css following
> >   >
> $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
> > ?>
> >
> > --
> > Dilip Godhani
> > Jr Software Developer, Entourage Solutions
> > e-mail: di...@entouragesolutions.com
> >   dilip.godh...@gmail.com
> > Web.:www.entouragesolutions.com
> > m. 9913822582
>
> 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: 404 error since updating to 1.3

2010-05-26 Thread Ed Propsner
I just updated to 1.3 stable from RC4 yesterday and I've been having the
same exact problem (amongst a few others) ever since.

I have to toy with it some more but it seems to only happen when passing
data into the controller action. As soon as the action sees $this->data
it dies. Even debug($this->data) causes it to fail.

I'm still toying with it and I'll re-post if I come up with anything worth
while. In the meantime it would be great to know if anyone had the same
problem and how they resolved it 8-)

- Ed


On Wed, May 26, 2010 at 5:21 AM, Taff  wrote:

> Hi,
> since updating my app to 1.3, one of my controllers is throwing a 404.
> All the other controllers/methods are working properly. I took a look
> at the controller and it's all the initial add edit delete view
> methods created during baking. Where should I start looking for the
> error, as I'm at a loss.
>
> Debugging is turned on but I'm still getting the 404 with no debugging
> information. The error is "The requested URL /app/webroot/webcasts/
> index/language:deu was not found on this server." Any help would be
> greatly appreciated.
>
> Cheers,
> Taff
>
> 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


404 error since updating to 1.3

2010-05-26 Thread Taff
Hi,
since updating my app to 1.3, one of my controllers is throwing a 404.
All the other controllers/methods are working properly. I took a look
at the controller and it's all the initial add edit delete view
methods created during baking. Where should I start looking for the
error, as I'm at a loss.

Debugging is turned on but I'm still getting the 404 with no debugging
information. The error is "The requested URL /app/webroot/webcasts/
index/language:deu was not found on this server." Any help would be
greatly appreciated.

Cheers,
Taff

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: how i apply css on $html->link

2010-05-26 Thread John Andersen
As written in the CakePHP book at:
http://book.cakephp.org/view/1435/Inserting-Well-Formatted-elements#link-1442

then what you have shown in your post is correct!
Now you just need to define your "current" style in your CSS file and
you are good to go!
Enjoy,
   John

On May 26, 9:41 am, Dilip Godhani  wrote:
> Can any One hellp
>
> How i Apply css in $html->link
> i give css following
>   $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
> ?>
>
> --
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>           dilip.godh...@gmail.com
> Web.:www.entouragesolutions.com
> m. 9913822582

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


Server does not support .htaccess files

2010-05-26 Thread Prof. No Time
Good day,

I need to install cakePHP on a server that does not support .htaccess
files:
(http://cp.micronet-ohio.com/psoft/servlet/psoft.hsphere.CP/oandoplc/
223909_0/psoft.hsphere.CP?template_name=quick/quick_view.html)

1. How do I go about this?

2. What are the implications?

Thank you.

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: how i apply css on $html->link

2010-05-26 Thread Narendra Padala
link('Add', array('controller'=>
$this->params['controller'],

'action'=>'view'),

array('class'=>'footer-link'));
 ?>


On Wed, May 26, 2010 at 2:19 PM, Narendra Padala wrote:

>echo $html->link('Add',
> 'add',array('class'=>'footer-link'));
> ?>
>
>
>
> On Wed, May 26, 2010 at 12:30 PM, Ed Propsner wrote:
>
>> I would use:
>>
>> $html->div('current', $html->link('Add', array(
>>'controller' => $this->params['controller'],
>> 'action'=>'view'
>>)
>>   )
>>);
>>
>> - Ed
>>
>> On Wed, May 26, 2010 at 2:41 AM, Dilip Godhani 
>> wrote:
>>
>>> Can any One hellp
>>>
>>> How i Apply css in $html->link
>>> i give css following
>>>  >> $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
>>> ?>
>>>
>>> --
>>> Dilip Godhani
>>> Jr Software Developer, Entourage Solutions
>>> e-mail: di...@entouragesolutions.com
>>>   dilip.godh...@gmail.com
>>> Web.: www.entouragesolutions.com
>>> m. 9913822582
>>>
>>> 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


Re: how i apply css on $html->link

2010-05-26 Thread Narendra Padala
link('Add',
'add',array('class'=>'footer-link'));
?>


On Wed, May 26, 2010 at 12:30 PM, Ed Propsner  wrote:

> I would use:
>
> $html->div('current', $html->link('Add', array(
>'controller' => $this->params['controller'],
> 'action'=>'view'
>)
>   )
>);
>
> - Ed
>
> On Wed, May 26, 2010 at 2:41 AM, Dilip Godhani wrote:
>
>> Can any One hellp
>>
>> How i Apply css in $html->link
>> i give css following
>>  > $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
>> ?>
>>
>> --
>> Dilip Godhani
>> Jr Software Developer, Entourage Solutions
>> e-mail: di...@entouragesolutions.com
>>   dilip.godh...@gmail.com
>> Web.: www.entouragesolutions.com
>> m. 9913822582
>>
>> 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


Re: Header element not refreshing!!!

2010-05-26 Thread WebbedIT
Seems a complicated implementation.  Can you show your code?
especially the call to the header and the header itself.

Paul.

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: HABTM Containable find('all') question

2010-05-26 Thread WebbedIT
Have you debugged the sql queries (set debug to 2) to work out where
the sql is not being generated correctly as the condition in principle
looks correct.

Maybe just typos but a few things look off

  'Friend' => array(
'conditions' => array(
  'Friend.id =' => $this->Auth->user('id'),
  'Friend.approved !=' => '-1'
)
  ),
  'Admirer' => array(
'conditions' => array(
  'Admirer.id =' => $this->Auth->user('id'),
  'Friend.approved !=' => '-1'
)
  ),

Friend and Admirer should be referenced with capital first letters and
there's no need to wrap conditions in AND array as that is what is
used by default.

HTH

Paul.

On May 26, 1:28 am, bradmaxs  wrote:
> Hello,
>
> I am working on a HABTM relationship.
>
> Here is my controller action:
>
>         function index() {
>                 $this->User->Behaviors->attach('Containable');
>                 $this->paginate = array(
>                         'contain' => array(
>                                 'friend' => array(
>                                         'conditions' => array(
>                                                 'friend.id =' => 
> $this->Auth->user('id'),
>                                         )
>                                 ),
>                                 'admirer' => array(
>                                         'conditions' => array(
>                                                 'admirer.id =' => 
> $this->Auth->user('id'),
>                                         )
>                                 ),
>                                 'UserPreference.image'
>                         ),
>                         'conditions' => array(
>                                 'User.id !=' => $this->Auth->user('id')
>                         ),
>                         'recursive' => true,
>                         'limit' => 15,
>                         'order' =>  array(
>                                 'User.first_name' => 'asc'
>                         )
>                 );
>                 $users = $this->paginate('User');
>                 $this->set(compact('users'));
>         }
>
> In my User model:
>
>         var $hasAndBelongsToMany = array(
>                 'friend' => array('className' => 'User',
>                 'joinTable' => 'Friend',
>             'foreignKey' => 'user_id',
>                         'associationForeignKey' => 'friend_id'
>                 ),
>                 'admirer' => array('className' => 'User',
>                         'joinTable' =>'Friend',
>                         'foreignKey' => 'friend_id',
>                         'associationForeignKey' => 'user_id')
>         );
>
> I have a column in the Friend table that has approved which is by
> default 0.  When someone approves, they get a 1 and if someone rejects
> they get a -1.
>
> In my index view I would like to exclude all Friend.approved => -1.
>
> Here is the dump:
>
> Array
> (
>     [0] => Array
>         (
>             [id] => 4
>             [username] => xxx
>             [password] => xxx
>             [first_name] => xxx
>             [last_name] => xxx
>             [street_address] => xxx
>             [city] => xxx
>             [state] => xxx
>             [zip] => xxx
>             [country] => xxx
>             [telephone] => xxx
>             [email_address] => xxx
>             [group_id] => xxx
>             [created] => 2010-05-03 17:33:54
>             [updated] => 2010-05-14 15:57:10
>             [Friend] => Array
>                 (
>                     [id] => 39
>                     [user_id] => 4
>                     [friend_id] => 29
>                     [approved] => -1
>                     [message] =>
>                     [created] => 2010-05-22 12:44:05
>                     [modified] => 2010-05-25 13:15:49
>                 )
>
>         )
>
> )
>
> If I put:
>
>                                'friend' => array(
>                                         'conditions' => array(
>                                         'AND' => array(
>                                                 'friend.id =' => 
> $this->Auth->user('id'),
>                                 'Friend.approved !=' => '-1'
>                                                 )
>                                         )
>                                 ),
>                                 'admirer' => array(
>                                         'conditions' => array(
>                                         'AND' => array(
>                                                 'admirer.id =' => 
> $this->Auth->user('id'),
>                                 'Friend.approved !=' => '-1'
>                                                 )
>                                         )
>                                 ),
>
> I get this:
>
> Array
> (
> )
>
> So the user is still showing up, and it seems that the array is just
> not getting any info.  I want to EXCLUDE the users who have a
> F

Re: how i apply css on $html->link

2010-05-26 Thread Ed Propsner
I would use:

$html->div('current', $html->link('Add', array(
   'controller' => $this->params['controller'],
   'action'=>'view'
   )
  )
   );

- Ed

On Wed, May 26, 2010 at 2:41 AM, Dilip Godhani wrote:

> Can any One hellp
>
> How i Apply css in $html->link
> i give css following
>   $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
> ?>
>
> --
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
>
> 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