Re: Can't share elements between apps

2009-04-24 Thread Ernesto

no it doesn't

i'll re-check the file... maybe i mistyped something

thx for the help

On 23 Apr, 14:26, John Andersen j.andersen...@gmail.com wrote:
 I just checked the source code, and CakePHP checkes for elements under
 each specified path, in the elements directory, so it should work, if
 you specify the view path to for example: \mycommonparts\views and
 all my common elements are placed in \mycommonparts\views\elements
 then it should work!

 Check out the source code at:
 http://api.cakephp.org/view_source/view/#line-331;

 Enjoy,
    John

 On Apr 23, 2:56 pm, Ernesto e.fanz...@gmail.com wrote:



  Hi John. Thx for the response.

  i already checked this cookbook page but... there's no $elementPath :(

  so i guessed maybe cake will search for a elements subdir in
  viewPath, as usually does with standard apps...

  but i had no luck T_T

  PS: sry for my ultra-bad english lol

  On 23 Apr, 08:46, John Andersen j.andersen...@gmail.com wrote:

   Hi Ernesto

   Try look at this http://book.cakephp.org/view/36/Additional-Class-
   Paths, maybe it may solve your issue :)

   Enjoy,
      John

   On Apr 22, 5:13 pm, Ernesto e.fanz...@gmail.com wrote:

Hello.

view sharing works, but not elements sharing

here's a snippet from my bootstrap.php

if (!defined('SHARED_ITEMS_FOLDER')) {
        define('SHARED_ITEMS_FOLDER',
CAKE_CORE_INCLUDE_PATH .'\shared_items');

}

$viewPaths = array(SHARED_ITEMS_FOLDER .'\views');

My webroot dir tree is this:

WebRoot
        cake
        apps
        shared_items
                helpers
                views
                        elements
--~--~-~--~~~---~--~~
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: Merge results of model-findAll with an array returned by function

2009-04-24 Thread Faza

Read the article on Containable, implemented it and
DAMN!
works like a charm!

Meanwhile, I've also added a slight modification to the table, so I can
make a hasMany relation.

Now, all I need is to learn to use Class::Set, to modify the array I have.

Thanks for help so far! *thumbs up*


 2009/4/23 Faza f...@ansi.pl:

 Hi all,

 more newbie questions on the way.

 I have few models related (mostly $belongsTo), and one of them requires
 a level 3 recursion, which is not-a-very-good practice. Especially that
 enabling lvl 3 recursion gathers much more data from the model than I
 really need.

 Therefore I thought that I could extend the model using some function to
 get the data I need, and then merge it with the result of findAll.

 The problem is, I don't have a clue where to start.

 Have you had a look at ContainableBehavior? I'd bet using that would
 be a lot easier.


 1st of all, how to make Cake run my function each iteration of the
 foreach $results as $result? I need this, because - obviously - I have
 to pass the id of each row to the function.

 Not necessarily. You could extract the IDs with one call using Set
 class and then make one query using the resulting array.

 $foreign_keys = Set::extract($results, '{n}.SomeModel.id');

 I still think you should be using contain, though, and avoiding the
 need for any of this.

 ...

 What I want to get, is that result of findAll will be expanded with the
 above fields.

 Plz bear with my newbieness and ask away if there's something I didn't
 describe good enough to be understood.

 You haven't given any indication of the *other* data, the initial find
 you're making, nor how all of these models are associated. There's not
 much to go on.

 



-- 
Jacek


--~--~-~--~~~---~--~~
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: cakephp auth component password field always empty why ??

2009-04-24 Thread Malcolm Krugger

Ok here is the view



?php
echo $form-create('Member' ,array('controller' = 'Members' ,
'action' = 'register'));
echo $form-input('Member.username');
echo $form-input('Member.password');
echo $form-input('Member.firstname');
echo $form-input('Member.lastname');
echo $form-input('Member.emailid');
echo $form-end('submit');
?

and here is the array

Array
(
[Member] = Array
(
[username] = sfasf
[password] =
[firstname] = asfas
[lastname] = fsafasf
[emailid] = asfsaf
)

)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Using SSL Proxy (access from two different URL's)

2009-04-24 Thread Galdan

Hi together,

i need your help for changing the configuration i can use the free SSL
Proxy of my Webhost.

My normal URL i call my webapplication is (for example) this:

http://www.mydomain.com/myapplication/

if i want to use a SSL secured connection to my application i've the
possibilitie to use the free SSL Proxy and call my application with
this URL:

https://ssl-proxy.com/mydomain.com/myapplication/

I don't know how i could configure my application in this way, because
if i try to access my application over the SSL-URL i get redirected to
the normal URL.

I hope you understand what I'm meaning :-)

Thank you very much in advance!

bye
Tom


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Set::extract and Set::combine - help needed

2009-04-24 Thread Faza

Hello again,

this is the array I'm working on:

Array
(
[0] = Array
(
[Design] = Array
(
[id] = 39
[design_no] = 1
[job_title] = gjgfjyjgyjf
[expected_date] = 2009-04-14
[customer_id] = 5
[designer_id] = 15
[status_id] = 1
[post_date] = 2009-04-23 13:11:23.247263+02
[author_id] = 73
)

[Author] = Array
(
[full_name] = SKP Admin
[id] = 73
)

[Designer] = Array
(
[full_name] = Jan Grzenda
[id] = 15
)

[CustomerNr] = Array
(
[id] = 5
[customers_number_name] = Test (2343)
)

[StatusHistory] = Array
(
[0] = Array
(
[since] = 2009-04-21 00:00:00+02
[status_names_id] = 1
[changer_id] = 74
[design_id] = 39
[StatusName] = Array
(
[text] = Nowe
)

[Changer] = Array
(
[full_name] = John Doe
)

)

[1] = Array
(
[since] = 2009-04-23 14:17:11.673985+02
[status_names_id] = 2
[changer_id] = 74
[design_id] = 39
[StatusName] = Array
(
[text] = Przydzielone grafikowi
)

[Changer] = Array
(
[full_name] = Ed Smith
)

)

)

)

I want to modify the [StatusHistory] branch.
So far, I'm extracting it using:

$hist = Set::extract($designs, '{n}.StatusHistory');

This results in:

Array
(
[0] = Array
(
[0] = Array
(
[since] = 2009-04-21 00:00:00+02
[status_names_id] = 1
[changer_id] = 74
[design_id] = 39
[StatusName] = Array
(
[text] = Nowe
)

[Changer] = Array
(
[full_name] = John Doe
)

)

[1] = Array
(
[since] = 2009-04-23 14:17:11.673985+02
[status_names_id] = 2
[changer_id] = 74
[design_id] = 39
[StatusName] = Array
(
[text] = Przydzielone grafikowi
)

[Changer] = Array
(
[full_name] = Ed Smith
)

)

)

I've tried endless combine params, but without success.
I want to achieve this:

Array
(
[0] = Array
(
[Nowe] = (StatusName.text) = Array
(
[since] = 2009-04-21 00:00:00+02
[Changer] = John Doe = (Changer.full_name)
)

[Przydzielone grafikowi] = Array
(
[since] = 2009-04-23 14:17:11.673985+02
[Changer] = Ed Smith
)

)

Last question, I want to replace the original [StatusHistory] with the new
array.

-- 
Jacek


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



Re: Plugin for MySQL Workbench: Who to contact?

2009-04-24 Thread rich...@home

I never even KNEW there was a CakePHP plugin for WB!

Damn, that's going to save me even more time! :-)


On Apr 23, 3:01 pm, Karsten Wutzke kwut...@web.de wrote:
 I'm referring to

 http://forums.mysql.com/read.php?155,258646,258824#msg-258824

 The CakePHP plugin for MySQL Workbench is supposed to be working with
 version 5.1, but it isn't.

 Who do I contact to clear things up?

 Karsten
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to install cakephp

2009-04-24 Thread gukan

I try so many manual but i can't how to install cakephp any one help
to me , it have any exe file or what it done after install .

--~--~-~--~~~---~--~~
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: cakephp auth component password field always empty why ??

2009-04-24 Thread Miles J

What is your security salt, or your encrypting function set to?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



DomDocument and XPath

2009-04-24 Thread nlte

I'm new to PHP, with little practice of OOP, and I'm trying to extend
the DomDocument class (in DOM) with a method that runs an XPath
selection:

class ExtDomDocument extends DomDocument {

public function selectNodes($xpath) {
$processor = new DOMXPath($this);
return $processor-query($xpath);
 }

}

This runs fine, but it seems better to me to have the DOMXPath object
instantiated in the constructor (so this is done only once and it can
be used by additional methods). The following code doesn't work but
I'd like to do something along those lines:

class ExtDomDocument extends DomDocument {

private $processor;

function __construct() {
parent::__construct();
$processor = new DOMXPath($this);
}

public function selectNodes($xpath) {
$processor = new DOMXPath($this);
return $processor-query($xpath);
 }

}

I'll be grateful for your help.

Nicolas

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Modelling associations, 2 tables/models

2009-04-24 Thread holub.mic...@gmail.com

Hi allI've got the following data model

dishes
  - id (PK)
  - name
  - dish_type_id (FK to dish_types)

dish_types
  - id (PK)
  - name

menus
 - id (PK)

dish_menus
- id (PK)
- dish_id (FK to dishes)
- menu_id (FK to menus)

now, my associations look like the following...

class Dish extends AppModel {
var $hasAndBelongsToMany = array('Menu' = array('with' =
'DishMenu'));
var $belongsTo = 'DishType';
}

class DishMenu extends AppModel {
var $belongsTo = array('Dish', 'Menu');
}

class DishType extends AppModel {
var $belongsTo = 'DishType';
}

class Menu extends AppModel {
var $hasAndBelongsToMany = array('Dish' = array('with' =
'DishMenu'));
}

Now If I load a menu and do pr($this-Menu-find('first'));

it prints this

[Menu] = Array
(
[id] = 1
[created] = 2009-04-23 15:16:38
[forday] = 2009-04-20
)

[Dish] = Array
(
[0] = Array
(
[id] = 1
[name_en] = Curried Fish
[name_cs] = xxx
[dish_type_id] = 1
[DishMenu] = Array
(
[id] = 1
[menu_id] = 1
[dish_id] = 1
)

)


So far all cool, menu-dish m:n works fine...the only problem that I'd
like to know the dish type. The pr listing shows only attribute
[dish_type_id] = 1 but no class DishType...why is that?

Thanks, Michal
--~--~-~--~~~---~--~~
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 to install cakephp

2009-04-24 Thread Faza

Hello there!

I did my first install following the below tutorials:

http://book.cakephp.org/view/29/Installation-Preparation
http://book.cakephp.org/view/32/Installation

(NB it's for Linux)
Don't have any experience with CakePHP installed on Windows, so probably
someone could provide a link for a tut or something.


 I try so many manual but i can't how to install cakephp any one help
 to me , it have any exe file or what it done after install .

 



-- 
Jacek


--~--~-~--~~~---~--~~
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: Pulling data to use in default.ctp menu

2009-04-24 Thread BlueC

On Apr 22, 3:58 pm, blake blake.jor...@gmail.com wrote:
 What controller would I use the component in to pass the data through
 to default.ctp?

I'm also new to cake but since noone else is answering I would guess
in the AppController (/app/app_controller.php)

I also have a Menu component and a Menu helper that I call from
default.ctp - I have added the component to the components array in
AppController and the helper to the helpers array in the same file and
it all works fine. Possibly the difference with mine is that it stores
the actual menu data in the user session but maybe yours works the
same?

FWIW I used the following link as a starting point for my menu
system:

http://www.palivoda.eu/2008/04/dynamic-menu-in-cakephp/

Chris

--~--~-~--~~~---~--~~
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: cakephp auth component password field always empty why ??

2009-04-24 Thread John Andersen

Try also debug($_POST); just to see if it is received from the
browser!
Turn off Auth and see if the data comes into the controller!
   John

On Apr 24, 10:29 am, Malcolm Krugger chennaiprogram...@gmail.com
wrote:
 Ok here is the view

 ?php
 echo $form-create('Member' ,array('controller' = 'Members' ,
 'action' = 'register'));
 echo $form-input('Member.username');
 echo $form-input('Member.password');
 echo $form-input('Member.firstname');
 echo $form-input('Member.lastname');
 echo $form-input('Member.emailid');
 echo $form-end('submit');
 ?

 and here is the array

 Array
 (
     [Member] = Array
         (
             [username] = sfasf
             [password] =
             [firstname] = asfas
             [lastname] = fsafasf
             [emailid] = asfsaf
         )

 )
--~--~-~--~~~---~--~~
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 to install cakephp

2009-04-24 Thread Walther

The installation is the same regardless of windows or Linux. Put it
into the document root for your server software and change the
required files.

On Apr 24, 12:10 pm, Faza f...@ansi.pl wrote:
 Hello there!

 I did my first install following the below tutorials:

 http://book.cakephp.org/view/29/Installation-Preparationhttp://book.cakephp.org/view/32/Installation

 (NB it's for Linux)
 Don't have any experience with CakePHP installed on Windows, so probably
 someone could provide a link for a tut or something.



  I try so many manual but i can't how to install cakephp any one help
  to me , it have any exe file or what it done after install .

 --
 Jacek
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Adsense Authentication

2009-04-24 Thread Marco.z

Good morning, I have a problem and seems that there is no answer in
internet. I have a site ( http://www.festeoneste.com ) whit some pages
reserved to the registered users. I want google adsense to crawl also
that pages, and it's possible to set in the adsense settings, an
username and a password. You write down the name of the post variable
and the value (I have created a 'google' user for that). The problem
is that cakePhp use an array data in the form to pass the values, and
is not possible to include the '[' and ']' char in the adsense
settings form.

I try to use the html code for that, but it doesn't work. How can I
let google know the login to crawl also reserved pages?

Thank you very much

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



Re: Model Association Not Creating Query Joins

2009-04-24 Thread Walther

In cases like what you are looking at it tends to work a bit better if
you rather do the find on the model you want to filter.

Something like:

$alert_ids = $this-Alert-AccountAlert-find (
'all',
array (
'conditions'=   array (
'AccountAlert.account_id'  = $account_id
),
'fields'=   array('Alert.id'),
)
);

That might work (Sorry, sitting at university, can't test).
Otherwise you can try the containable behaviour, that should be able
to do what you wish.

On Apr 24, 2:45 am, Rob Wilkerson r...@robwilkerson.org wrote:
 I have an Alert model, an Account model and an AccountAlert model:

 Alert hasMany AccountAlert
 Account hasMany AccountAlert
 AccountAlert belongsTo ( Alert, Account )

 AccountAlert has several other defining fields, so it has its own
 primary key in the database as well as being its own model. IOW, it's
 more than a simple linking table. It has foreign keys to the alerts
 and accounts tables (alert_id and account_id, respectively).

 From AccountModel, I'm trying to retrieve all of the Alerts for a
 given Account.  If I try a simple find:

 $this-Alert-find ( 'all' )

 I get each Alert and each AccountAlert that has that alert. If,
 however, I try to restrict by the account_id then I get an unknown
 column error:

 $alert_ids = $this-Alert-find (
 'all',
 array (
 'conditions'=   array (
 'AccountAlert.account_id'  = $account_id
 ),
 'fields'=   array('id'),
 )
 );

 Looking at the debug SQL, no join is being created. Since the model
 associations are intact (I assume this is the case since the simple
 find() returns data for both models), should CakePHP be building the
 join automagically and, therefore, understanding the
 AccountAlert.account_id syntax in my condition?

 Even being relatively new to CakePHP, it still seems like I should
 have run into this before, but I can't remember having seen this. Any
 push in the right direction would be much appreciated.
--~--~-~--~~~---~--~~
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: CakeFest Berlin 2009 officially announced

2009-04-24 Thread AgBorkowski

We will be there

big rgd AgBorkowski
http://lowcy.com.pl

On 24 Mar, 06:24, Nate nate.ab...@gmail.com wrote:
 After much hype and speculation, the next CakeFest event, which will
 take place in Berlin beginning July 9th, has been officially
 announced.  You can read the full details, along with some other
 important announcements on the 
 Bakery:http://bakery.cakephp.org/articles/view/cakephp-deutschland

 Or, go straight to the conference site here:http://cakefest.org/

 If you'd like a chance to win a free pass to the conference, check 
 outhttp://cakefest.org/pages/badges

 Hope to see you there!
--~--~-~--~~~---~--~~
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: cakephp auth component password field always empty why ??

2009-04-24 Thread Malcolm Krugger


Miles

Configure::write('Security.level', 'medium');
/**
 * A random string used in security hashing methods.
 */
Configure::write('Security.salt',
'DsssggYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');

ALSO IN DEBUGGING output

1 DESCRIBE `members`
2 SELECT `member`.`id`, `member`.`username`, `member`.`password`,
`member`.`firstname`, `member`.`lastname`, `member`.`emailid` FROM
`members` AS `member` WHERE `member`.`username` = 'zfa' AND
`member`.`password` = '8381bcf91bef08a22e8748653962b231731fbb12' LIMIT
1
3 INSERT INTO `members` (`username`, `password`, `firstname`,
`lastname`, `emailid`) VALUES ('zfa', NULL, 'd', 'ADa', 'AdsaD')
4 SELECT LAST_INSERT_ID() AS insertID

John


$_POST


Array
(
[_method] = POST
[data] = Array
(
[Member] = Array
(
[username] = zfa
[password] = sdfadsf
[firstname] = d
[lastname] = ADa
[emailid] = AdsaD
)

)

)



Disabling the Auth module saves the record the password is saved in
plain text


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



Re: Set::extract and Set::combine - help needed

2009-04-24 Thread grigri
Some of what you want to do is possible with the set class; other bits
would be more complicated.

With this approach, the best you could achieve would be a nasty mess
of array_combine, array_keys and various set calls, all nested and
difficult to follow.

Although I love the Set class with all my heart, this is one instance
where I believe a simple loop would be easier to code, easier to
maintain, and ultimately more efficient for the server and the coder.

foreach($data as $i = $bacon) {
  $statusHistory = array();
  foreach($bacon['StatusHistory'] as $eggs) {
$statusHistory[$eggs['StatusName']['text']] = array(
  'since' = $eggs['since'],
  'Changer' = $ggs['Changer']['full_name']
);
  }
  $data[$i]['StatusHistory'] = $statusHistory;
}

Job done!

hth
grigri

On Apr 24, 9:16 am, Faza f...@ansi.pl wrote:
 Hello again,

 this is the array I'm working on:

 Array
 (
     [0] = Array
         (
             [Design] = Array
                 (
                     [id] = 39
                     [design_no] = 1
                     [job_title] = gjgfjyjgyjf
                     [expected_date] = 2009-04-14
                     [customer_id] = 5
                     [designer_id] = 15
                     [status_id] = 1
                     [post_date] = 2009-04-23 13:11:23.247263+02
                     [author_id] = 73
                 )

             [Author] = Array
                 (
                     [full_name] = SKP Admin
                     [id] = 73
                 )

             [Designer] = Array
                 (
                     [full_name] = Jan Grzenda
                     [id] = 15
                 )

             [CustomerNr] = Array
                 (
                     [id] = 5
                     [customers_number_name] = Test (2343)
                 )

             [StatusHistory] = Array
                 (
                     [0] = Array
                         (
                             [since] = 2009-04-21 00:00:00+02
                             [status_names_id] = 1
                             [changer_id] = 74
                             [design_id] = 39
                             [StatusName] = Array
                                 (
                                     [text] = Nowe
                                 )

                             [Changer] = Array
                                 (
                                     [full_name] = John Doe
                                 )

                         )

                     [1] = Array
                         (
                             [since] = 2009-04-23 14:17:11.673985+02
                             [status_names_id] = 2
                             [changer_id] = 74
                             [design_id] = 39
                             [StatusName] = Array
                                 (
                                     [text] = Przydzielone grafikowi
                                 )

                             [Changer] = Array
                                 (
                                     [full_name] = Ed Smith
                                 )

                         )

                 )

         )

 I want to modify the [StatusHistory] branch.
 So far, I'm extracting it using:

 $hist = Set::extract($designs, '{n}.StatusHistory');

 This results in:

 Array
 (
     [0] = Array
         (
             [0] = Array
                 (
                     [since] = 2009-04-21 00:00:00+02
                     [status_names_id] = 1
                     [changer_id] = 74
                     [design_id] = 39
                     [StatusName] = Array
                         (
                             [text] = Nowe
                         )

                     [Changer] = Array
                         (
                             [full_name] = John Doe
                         )

                 )

             [1] = Array
                 (
                     [since] = 2009-04-23 14:17:11.673985+02
                     [status_names_id] = 2
                     [changer_id] = 74
                     [design_id] = 39
                     [StatusName] = Array
                         (
                             [text] = Przydzielone grafikowi
                         )

                     [Changer] = Array
                         (
                             [full_name] = Ed Smith
                         )

                 )

         )

 I've tried endless combine params, but without success.
 I want to achieve this:

 Array
 (
     [0] = Array
         (
             [Nowe] = (StatusName.text) = Array
                 (
                     [since] = 2009-04-21 00:00:00+02
                     [Changer] = John Doe = (Changer.full_name)
                 )

             [Przydzielone grafikowi] = Array
                 (
                     [since] = 2009-04-23 14:17:11.673985+02
                     [Changer] = Ed 

Re: Set::extract and Set::combine - help needed

2009-04-24 Thread Faza
Mister,

I'll be damn. Works perfectly, and - what is more than expected - I
understand why!

Thanks a bunch.
Damn. Awesome :D


 Some of what you want to do is possible with the set class; other bits
 would be more complicated.

 With this approach, the best you could achieve would be a nasty mess
 of array_combine, array_keys and various set calls, all nested and
 difficult to follow.

 Although I love the Set class with all my heart, this is one instance
 where I believe a simple loop would be easier to code, easier to
 maintain, and ultimately more efficient for the server and the coder.

 foreach($data as $i = $bacon) {
   $statusHistory = array();
   foreach($bacon['StatusHistory'] as $eggs) {
 $statusHistory[$eggs['StatusName']['text']] = array(
   'since' = $eggs['since'],
   'Changer' = $ggs['Changer']['full_name']
 );
   }
   $data[$i]['StatusHistory'] = $statusHistory;
 }

 Job done!

 hth
 grigri

 On Apr 24, 9:16 am, Faza f...@ansi.pl wrote:
 Hello again,

 this is the array I'm working on:

 Array
 (
     [0] = Array
         (
             [Design] = Array
                 (
                     [id] = 39
                     [design_no] = 1
                     [job_title] = gjgfjyjgyjf
                     [expected_date] = 2009-04-14
                     [customer_id] = 5
                     [designer_id] = 15
                     [status_id] = 1
                     [post_date] = 2009-04-23 13:11:23.247263+02
                     [author_id] = 73
                 )

             [Author] = Array
                 (
                     [full_name] = SKP Admin
                     [id] = 73
                 )

             [Designer] = Array
                 (
                     [full_name] = Jan Grzenda
                     [id] = 15
                 )

             [CustomerNr] = Array
                 (
                     [id] = 5
                     [customers_number_name] = Test (2343)
                 )

             [StatusHistory] = Array
                 (
                     [0] = Array
                         (
                             [since] = 2009-04-21 00:00:00+02
                             [status_names_id] = 1
                             [changer_id] = 74
                             [design_id] = 39
                             [StatusName] = Array
                                 (
                                     [text] = Nowe
                                 )

                             [Changer] = Array
                                 (
                                     [full_name] = John Doe
                                 )

                         )

                     [1] = Array
                         (
                             [since] = 2009-04-23 14:17:11.673985+02
                             [status_names_id] = 2
                             [changer_id] = 74
                             [design_id] = 39
                             [StatusName] = Array
                                 (
                                     [text] = Przydzielone grafikowi
                                 )

                             [Changer] = Array
                                 (
                                     [full_name] = Ed Smith
                                 )

                         )

                 )

         )

 I want to modify the [StatusHistory] branch.
 So far, I'm extracting it using:

 $hist = Set::extract($designs, '{n}.StatusHistory');

 This results in:

 Array
 (
     [0] = Array
         (
             [0] = Array
                 (
                     [since] = 2009-04-21 00:00:00+02
                     [status_names_id] = 1
                     [changer_id] = 74
                     [design_id] = 39
                     [StatusName] = Array
                         (
                             [text] = Nowe
                         )

                     [Changer] = Array
                         (
                             [full_name] = John Doe
                         )

                 )

             [1] = Array
                 (
                     [since] = 2009-04-23 14:17:11.673985+02
                     [status_names_id] = 2
                     [changer_id] = 74
                     [design_id] = 39
                     [StatusName] = Array
                         (
                             [text] = Przydzielone grafikowi
                         )

                     [Changer] = Array
                         (
                             [full_name] = Ed Smith
                         )

                 )

         )

 I've tried endless combine params, but without success.
 I want to achieve this:

 Array
 (
     [0] = Array
         (
             [Nowe] = (StatusName.text) = Array
                 (
                     [since] = 2009-04-21 00:00:00+02
                     [Changer] = John Doe = (Changer.full_name)
                 )

           

naming conventions help

2009-04-24 Thread forrestgump

hey guys,
 I ran into a problem with the model and table naming conventions

I have the following:

1)model: department.php :-
?php
class Department extends AppModel
{

  var $displayField = 'department';
  var $useTable = false;
}
?

2)contoller: deparments_conrtoller.php :-
?php
class DepartmentsController extends AppController {
   function index()
   {
   $name = 'Department';
   }
}
?

3)View folder: departments and index.php:-
 TEST!!!

here is the problem when i view the page (appname)/deparments i get
TEST!!! as expected.i created a table called departments with
fields id,departmentand i commented the line var $useTable =
false; in deparment model.now i get an error which says:

Not Found

Error: The requested address '/departments' was not found on this
server.

Can someone tell me what iam doing wrong im guessing it is in my
naming conventions...can someone correct me?
will appreciate any help.

Regards,
Forrestgump

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model Association via conditions fails!

2009-04-24 Thread ohneworte

Hello Together,
I want to link two Models without using a Foreign Key, but using some
Conditions instead. Here is my example:

Model:
-
class Category extends AppModel {
var $name = Category;
var $actsAs = array(Containable);

var $hasMany = array(
Zone = array(
foreignKey = false,
conditions = array(
AND = array(Category.width = Zone.width, 
Category.height =
Zone.height)
)
)
);
}

Controller:
--
$category = $this-Category-find(first, array(
conditions = array(Category.id = 1),
contain = array(
Zone
)
));

Result:
--
SQL Error: 1054: Unknown column 'Category.width' in 'where clause'

That seems clear if you make a look on the generated Query:
SELECT ... FROM 'zones' AS 'Zone' WHERE (('Category'.'width' = 
'Zone'.'width') AND ('Category'.'height' = 'Zone'.'height')) 

No Join occurs - but why? Can anybody help me out?
I appreciate any help on this issue.

Regards.
--~--~-~--~~~---~--~~
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: Configuring CSS

2009-04-24 Thread christopher

Thats great I have that done, I am struggling more with the correct
code to place in the default.ctp and if I have to call the CSS any
where else.  Thanks for your reply so far.

On Apr 24, 1:49 am, brian bally.z...@gmail.com wrote:
 By default, your stylesheets should be in webroot/css.



 On Thu, Apr 23, 2009 at 3:32 PM, christopher toze...@hotmail.co.uk wrote:

  Hi could anyone tell me how to use my own CSS style sheet in Cake
  PHP.  I have just started using CakePHP and am having difficulty.
  I have created teh default.ctp file in the web root and the CSS file
  in the views layout folder but I think  the default code is wrong.

  Would appreciate a simple guide on how to set it up.

  Thanks- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp auth component password field always empty why ??

2009-04-24 Thread Malcolm Krugger

I have not set security set hash anywhere

Im using the following

$this-Auth-userModel = 'Member';


$this-Auth-loginAction = array('controller' = 'members');
$this-Auth-autoRedirect=true;
$this-Auth-allow('register');
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Immutable params in Dispatcher::_invoke()

2009-04-24 Thread Reuben Helms
Hi all
I was wanting to know if it is by design that the $params argument is
immutable in Dispatcher::_invoke()?

I'm working on a SEF solution where I'd like to do the slug translation in
the beforeFilter of my App Controller, and then set $this-params['pass'][0]
to be the id of my translated slug.

However, because _invoke is defined as _invoke($controller, $params), any
changes in beforeFilter to $this-params never make it back into _invoke to
be passed to $controller-dispatchMethod();

By changing the _invoke to be _invoke(controller, $params), I can play
with param values in the beforeFilter, and have them passed through to the
action.

Looking at the assignment of the Dispatcher param to the controller in
Dispatcher::dispatch() (Line 169: dispatcher.php for Cake 1.2.2.8120 :
 $controller-params
= $this-params;), it looks as though there might have been an original
intention to have any changed params in the controller reflected through to
the dispatcher version, and vis versa.

Just wondering if anyone has any informed feedback on this, and if it would
be worth putting a Trac ticket through for it.

The downside of the current method is that I have to resolve the slug twice.
 Once for the beforeFilter of the App Controller, and again on the actual
action being called.

Regards
Reuben Helms

--~--~-~--~~~---~--~~
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: Auth Unexpected Behavior

2009-04-24 Thread AgBorkowski

i have the same problem most of them in many ajax (suggest) request,
strategy is simple my script after 4th+n request return sql debug
after that every action were logged out

at past i create fit request controler for eg. xhr_controller 
controller,

so my fit controler loks like

XhrController ext Controller{
 $uses = array();
 $helpers = array();
 $compnenets = array('RequestHandller');

 function suggest($field){ // Warning SqlInjection only eg.
  App:import('Model'[]
 }
}

UsersController ext AppController{
 ad(){}
}
 but my suggest request lok that /xhr/$field/q=

its work fine but in my reuest i need Auth :

On 29 Mar, 01:42, rartavia royarta...@gmail.com wrote:
 logout: thanks for your answer, i'm using mayorly (hah nice word) ajax
 calls for my app but there are some not ajax ones and i'm using
 requestAction at least one time witch is suggested using it with
 cache. I'll try $this-disableCache(); under requestHandler-isAjax
 maybe, i'll
 look how that works. But I think the unexpected behavior was all
 about what suggested JamesF, the camel cased action names. Now my real
 problem is swfupload /controller/upload action, where my Auth-user
 returns null. Again i'm using 2.2.0 Beta 5 2008-01-29

 thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



img tags and autolink

2009-04-24 Thread donnerbeil

Hi,

On my site i have a forum and i would like to permit users to add
images to their posts. So first I had a web-editor for html. And I'm
considering an BBcode editor for security reasons.
But for both solutions there is a problem: The img tags are saved in
the DB, for example:

im src=http://www.example.com; alt=example /

Now in my view I use the $text-autoLink() method to link any http or
email links in the post. But the autoLink method destroys the value of
the src attributes in the img-tags.

Actually it would be best, if cake didn't autoLink urls inside tags.
For a-tags this works fine, but not for img-tags.

Any solution for this or is this worth a ticket?

Thanks in advance

Donnerbeil
--~--~-~--~~~---~--~~
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: cakephp auth component password field always empty why ??

2009-04-24 Thread John Andersen

As Miles J asked you about, has you changed the encryption function -
like Security::setHash('md5'); - to something else?

What other settings have you set in the Auth component?

I ask because we know that the password is submitted, but only gets
into the $this-data array, when Auth is not active!
   John

On Apr 24, 2:06 pm, Malcolm Krugger chennaiprogram...@gmail.com
wrote:
 Miles

         Configure::write('Security.level', 'medium');
 /**
  * A random string used in security hashing methods.
  */
         Configure::write('Security.salt',
 'DsssggYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');

 ALSO IN DEBUGGING output

 1 DESCRIBE `members`
 2 SELECT `member`.`id`, `member`.`username`, `member`.`password`,
 `member`.`firstname`, `member`.`lastname`, `member`.`emailid` FROM
 `members` AS `member` WHERE `member`.`username` = 'zfa' AND
 `member`.`password` = '8381bcf91bef08a22e8748653962b231731fbb12' LIMIT
 1
 3 INSERT INTO `members` (`username`, `password`, `firstname`,
 `lastname`, `emailid`) VALUES ('zfa', NULL, 'd', 'ADa', 'AdsaD')
 4 SELECT LAST_INSERT_ID() AS insertID

 John

 $_POST

 Array
 (
     [_method] = POST
     [data] = Array
         (
             [Member] = Array
                 (
                     [username] = zfa
                     [password] = sdfadsf
                     [firstname] = d
                     [lastname] = ADa
                     [emailid] = AdsaD
                 )

         )

 )

 Disabling the Auth module saves the record the password is saved in
 plain text
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Translate Behavior

2009-04-24 Thread Henrique Machado
Hello Guys..

I'm two days tryin to understand and trying to get Translate Behavior
working..

I've folowing the manual (http://book.cakephp.org/view/92/Translate)

OK, i have a table i18n and my model is ok.

After few hours looking for a example how to translate my records i found
this test:

http://www.mibbit.com/pb/pUw02l


Ok, now i can understand a bit, but:

If i'm adding a new record, like a post, how can i make title field an
array?

Is two forms?

I'm lost..

ty

Henrique Machado

--~--~-~--~~~---~--~~
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: cakephp auth component password field always empty why ??

2009-04-24 Thread Stu

Just for the heck of it, try changing your field's name to something
else.  It's possible that cake handles 'password' fields a particular
way.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Tips for cutting queries and load time?

2009-04-24 Thread Dave Maharaj :: WidePixels.com

I was hoping to get some general tips on how to speed up load time and cut
down on the number of queries in a request.
 
I have for example 18 queries took 123 ms for 1 page. I have been cleaning
up find queries to use contain and only query fields I need cleaning out
ones not needed, unbind models in some actions to remove tables not needing
to get data from on others and in some cases cacheQueries. 
 
In my 18 queries took 123 ms example there are no describe tables...just
the ARO/ACO and general queries to grab info for the page. I have not made
any custom JOINS or anything anywhere in the site, only the ones cake makes
with its relationship tables.
 
Can someone provide info on how to speed things up beyond what I have been
doing?

thanks
 
Dave 


--~--~-~--~~~---~--~~
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: Tips for cutting queries and load time?

2009-04-24 Thread Faza

I use database views, at least for the view pages, if possible.

It's faster to perform joins db-side, and then return just a simple view 
to CakePHP.


My 0.02USD

Dave Maharaj :: WidePixels.com pisze:
 I was hoping to get some general tips on how to speed up load time and cut
 down on the number of queries in a request.
  
 I have for example 18 queries took 123 ms for 1 page. I have been cleaning
 up find queries to use contain and only query fields I need cleaning out
 ones not needed, unbind models in some actions to remove tables not needing
 to get data from on others and in some cases cacheQueries. 
  
 In my 18 queries took 123 ms example there are no describe tables...just
 the ARO/ACO and general queries to grab info for the page. I have not made
 any custom JOINS or anything anywhere in the site, only the ones cake makes
 with its relationship tables.
  
 Can someone provide info on how to speed things up beyond what I have been
 doing?

 thanks
  
 Dave 


 

   


--~--~-~--~~~---~--~~
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 not working - cake.generic.css not found

2009-04-24 Thread Nature Lover

Hi!

I have downloaded CakePHP latest stable release.
extracted on the test server with 755 permission on everything and 777
on tmp folder.

The home page is showing with the default layout but not stylesheet
coloring.
In the FireBug HTML coding the 404 errors is return for default
stylesheet of cake

Please help me to set the permissions on folders

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Help with cakephp conform sql query

2009-04-24 Thread voocake

Hello,

I have nice SQL query which makes most of the work for me, but i have
no plan how to convert it to a cakephp conform condition array. I'm
aware of the possibility to make a custom query, but i'm trying to
avoid this.

May someone can help me with this?

Here is the statement:

SELECT DATE_FORMAT(created, '%d.%m.%Y') AS sdate, COUNT(savedtime) AS
saved , COUNT(encashedtime) AS encashed FROM users_books WHERE
voucher_id IN (8, 124, 120)
AND created = NOW()
AND DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY sdate
ORDER BY sdate


Thx
voocake

--~--~-~--~~~---~--~~
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: CakePHP not working - cake.generic.css not found

2009-04-24 Thread Faza

Make sure that the directory is chown to www server's user.

e.g. in my Debian I did:
chown -R www-data:www-data /path/to/cake/
chmod -R 755 /path/to/cake
chmod -R 777 /path/to/cake/tmp

Never had any permission-related issues.

Nature Lover pisze:
 Hi!

 I have downloaded CakePHP latest stable release.
 extracted on the test server with 755 permission on everything and 777
 on tmp folder.

 The home page is showing with the default layout but not stylesheet
 coloring.
 In the FireBug HTML coding the 404 errors is return for default
 stylesheet of cake

 Please help me to set the permissions on folders

 Thanks!
 

   


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



Re: CakePHP not working - cake.generic.css not found

2009-04-24 Thread Nature Lover

What can I do for the online server

There owner cannot be changed
Permissions I have assigned
But still not working

Thanks for the reply!

On Apr 24, 8:02 pm, Faza f...@ansi.pl wrote:
 Make sure that the directory is chown to www server's user.

 e.g. in my Debian I did:
 chown -R www-data:www-data /path/to/cake/
 chmod -R 755 /path/to/cake
 chmod -R 777 /path/to/cake/tmp

 Never had any permission-related issues.

 Nature Lover pisze:

  Hi!

  I have downloaded CakePHP latest stable release.
  extracted on the test server with 755 permission on everything and 777
  on tmp folder.

  The home page is showing with the default layout but not stylesheet
  coloring.
  In the FireBug HTML coding the 404 errors is return for default
  stylesheet of cake

  Please help me to set the permissions on folders

  Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Tips for cutting queries and load time?

2009-04-24 Thread Alexandru Ciobanu

On 04/24/2009 05:08 PM, Dave Maharaj :: WidePixels.com wrote:

 Can someone provide info on how to speed things up beyond what I have been
 doing?

I don't know what you have been doing but here's Matt's '8 Way for speed'
http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/



--~--~-~--~~~---~--~~
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: Tips for cutting queries and load time?

2009-04-24 Thread Martin Westin

Views, I haven't got my head into yet but it sounds like I probably
should :)

That is a lot of time for so few queries IMHO. Possibly one or a few
are taking very long because they return many rows. Whenever I return
more than 20 rows of anything I usually just want to count them or
somehow pull stats from them.

/Martin


On Apr 24, 4:08 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I was hoping to get some general tips on how to speed up load time and cut
 down on the number of queries in a request.

 I have for example 18 queries took 123 ms for 1 page. I have been cleaning
 up find queries to use contain and only query fields I need cleaning out
 ones not needed, unbind models in some actions to remove tables not needing
 to get data from on others and in some cases cacheQueries.

 In my 18 queries took 123 ms example there are no describe tables...just
 the ARO/ACO and general queries to grab info for the page. I have not made
 any custom JOINS or anything anywhere in the site, only the ones cake makes
 with its relationship tables.

 Can someone provide info on how to speed things up beyond what I have been
 doing?

 thanks

 Dave
--~--~-~--~~~---~--~~
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: naming conventions help

2009-04-24 Thread brian

Bump your debug up to 2 in core.php. I suspect the 404 you're seeing
is due to debug being at 0. There's likely an error in there
somewhere.

On Fri, Apr 24, 2009 at 8:19 AM, forrestgump vikhya...@gmail.com wrote:

 hey guys,
  I ran into a problem with the model and table naming conventions

 I have the following:

 1)model: department.php :-
 ?php
 class Department extends AppModel
 {

  var $displayField = 'department';
      var $useTable = false;
 }
 ?

 2)contoller: deparments_conrtoller.php :-
 ?php
 class DepartmentsController extends AppController {
   function index()
   {
       $name = 'Department';
   }
 }
 ?

 3)View folder: departments and index.php:-
  TEST!!!

 here is the problem when i view the page (appname)/deparments i get
 TEST!!! as expected.i created a table called departments with
 fields id,departmentand i commented the line var $useTable =
 false; in deparment model.now i get an error which says:

 Not Found

 Error: The requested address '/departments' was not found on this
 server.

 Can someone tell me what iam doing wrong im guessing it is in my
 naming conventions...can someone correct me?
 will appreciate any help.

 Regards,
 Forrestgump

 


--~--~-~--~~~---~--~~
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: Configuring CSS

2009-04-24 Thread brian

If you have a stylesheet in app/webroot/css/main.css your layout file
should have:

echo $html-css('main');

Note that you do not include the extension, nor the directories. If
your stylesheet is in a subdirectory,
app/webroot/css/some_dir/main.css:

echo $html-css('some_dir/main');

It's pretty much the same principle as with $javascript-link()

On Fri, Apr 24, 2009 at 5:12 AM, christopher toze...@hotmail.co.uk wrote:

 Thats great I have that done, I am struggling more with the correct
 code to place in the default.ctp and if I have to call the CSS any
 where else.  Thanks for your reply so far.

 On Apr 24, 1:49 am, brian bally.z...@gmail.com wrote:
 By default, your stylesheets should be in webroot/css.



 On Thu, Apr 23, 2009 at 3:32 PM, christopher toze...@hotmail.co.uk wrote:

  Hi could anyone tell me how to use my own CSS style sheet in Cake
  PHP.  I have just started using CakePHP and am having difficulty.
  I have created teh default.ctp file in the web root and the CSS file
  in the views layout folder but I think  the default code is wrong.

  Would appreciate a simple guide on how to set it up.

  Thanks- Hide quoted text -

 - Show quoted text -
 


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



Re: Tips for cutting queries and load time?

2009-04-24 Thread brian

On Fri, Apr 24, 2009 at 11:10 AM, Martin Westin
martin.westin...@gmail.com wrote:

 Views, I haven't got my head into yet but it sounds like I probably
 should :)

Views can make a big difference. Well worth looking into.
Unfortunately, they require using query(). I thought I saw something
about being able to query views in 1.3. Or maybe that's just wishful
thinking. I admit that it's not clear to me how that could be fit into
Cake in an efficient manner.

 That is a lot of time for so few queries IMHO. Possibly one or a few
 are taking very long because they return many rows. Whenever I return
 more than 20 rows of anything I usually just want to count them or
 somehow pull stats from them.

There may also be candidates for caching in your data retrieval. Give
some thought to how often certain queries are made fro a particular
user. If the data will always be the same, cache it.

Also, have a look at the queries themselves. For MySQL, in the
terminal, run EXPLAIN your_query [1] to see whether or not your
indexes are being used. Note that simply creating a key does not
guarantee it'll be used. If your query includes a function, for
instance, your key may be ignored. [2] This is crucial to understand
if you're concerned about performance.

[1] http://dev.mysql.com/doc/refman/5.1/en/using-explain.html
[2] 
http://www.mysqlperformanceblog.com/2007/10/17/mysql-performance-eliminating-order-by-function/

--~--~-~--~~~---~--~~
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: Pulling data to use in default.ctp menu

2009-04-24 Thread blake

Thanks for the advice. Interesting idea to use a component and helper.
I might give that a shot and see where it gets me. The link looks like
a pretty good head start anyway.


-Blake


On Apr 24, 5:55 am, BlueC messageforch...@googlemail.com wrote:
 On Apr 22, 3:58 pm, blake blake.jor...@gmail.com wrote:

  What controller would I use the component in to pass the data through
  to default.ctp?

 I'm also new to cake but since noone else is answering I would guess
 in the AppController (/app/app_controller.php)

 I also have a Menu component and a Menu helper that I call from
 default.ctp - I have added the component to the components array in
 AppController and the helper to the helpers array in the same file and
 it all works fine. Possibly the difference with mine is that it stores
 the actual menu data in the user session but maybe yours works the
 same?

 FWIW I used the following link as a starting point for my menu
 system:

 http://www.palivoda.eu/2008/04/dynamic-menu-in-cakephp/

 Chris
--~--~-~--~~~---~--~~
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 - MySQL Connection issue

2009-04-24 Thread Venki

Hi
I am new to CakePHP. I have installed the following in my ubuntu
machine.

PHP  - 5.2.6-2ubuntu4.2
Apache2
MySQL 5.0.67
CakePHP - 1.2.2.8120

Everything went okay, my first CakePHP page came up fine (With two
warnings, Security.salt and database connection).

I have fixed the Security.salt issue and renamed the
database.php.default file to database.php.
I have also changed the appropriate parameters to connect to my local
mysql.

Now my CakePHP welcome page shows only this

Release Notes for CakePHP 1.2.2.8120.
Read the changelog

Your tmp directory is writable.

The FileEngine is being used for caching. To change the config edit
APP/config/core.php

Your database configuration file is present.


As you can see, it recognizes the database configuration file, but it
doesn't display anything after that.

Can anyone help me troubleshoot this issue.

Thanks a lot
Venki

--~--~-~--~~~---~--~~
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: Help with cakephp conform sql query

2009-04-24 Thread harpax

Hi,

The following should do the job:

[..]
// for the controller
$params['fields'] = array(
'DATE_FORMAT(created, '%d.%m.%Y') AS sdate',
'COUNT(savedtime) AS saved',
'COUNT(encashedtime) AS encashed');
$params['conditions'] = array(
'voucher_id' = array(8, 124, 120),
'created = NOW()',
'DATE_SUB(NOW(), INTERVAL 30 DAY)'
);
$params['order'] = 'sdate';
$params['group'] = 'sdate';
$res = $this-UsersBook-find('all', $params);
[..]

Hope that helps,
harpax


On 24 Apr., 16:28, voocake vooc...@gmail.com wrote:
 Hello,

 I have nice SQL query which makes most of the work for me, but i have
 no plan how to convert it to a cakephp conform condition array. I'm
 aware of the possibility to make a custom query, but i'm trying to
 avoid this.

 May someone can help me with this?

 Here is the statement:

 SELECT DATE_FORMAT(created, '%d.%m.%Y') AS sdate, COUNT(savedtime) AS
 saved , COUNT(encashedtime) AS encashed FROM users_books WHERE
 voucher_id IN (8, 124, 120)
 AND created = NOW()
 AND DATE_SUB(NOW(), INTERVAL 30 DAY)
 GROUP BY sdate
 ORDER BY sdate

 Thx
 voocake

--~--~-~--~~~---~--~~
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: Translate Behavior

2009-04-24 Thread jitka (poLK)

$label = __('Title', true);
echo $form-input('Post.title.cze', array('type' = 'text', 'label' =
$label . ' (cze)'));
echo $form-input('Post.title.eng', array('type' = 'text', 'label' =
$label . ' (eng)'));

--~--~-~--~~~---~--~~
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: Call Validate routines manually from controller

2009-04-24 Thread Zoltan

http://book.cakephp.org/view/410/Validating-Data-from-the-Controller

On Apr 24, 12:32 am, Temujin calebjo...@gmail.com wrote:
 I know this will make some MVC purists out there cringe, but is there
 a way to manually call Validate routines from within the controller?

 I have a simple form that needs to validate multiple email addresses
 and I don't want to make a model to handle just this one validation
 check.

 Trying the following:
 Validate::email($email)

 ... from the controller results in Class 'Validate' not found.
--~--~-~--~~~---~--~~
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: Help with cakephp conform sql query

2009-04-24 Thread brian

Note that you're fields will not be under 'UsersBook' in the array
because you're using DATE_FORMAT and COUNT. Do a debug() on the result
to see what I mean.

On Fri, Apr 24, 2009 at 2:48 PM, harpax apsczo...@googlemail.com wrote:

 Hi,

 The following should do the job:

 [..]
 // for the controller
 $params['fields'] = array(
    'DATE_FORMAT(created, '%d.%m.%Y') AS sdate',
    'COUNT(savedtime) AS saved',
    'COUNT(encashedtime) AS encashed');
 $params['conditions'] = array(
    'voucher_id' = array(8, 124, 120),
    'created = NOW()',
    'DATE_SUB(NOW(), INTERVAL 30 DAY)'
 );
 $params['order'] = 'sdate';
 $params['group'] = 'sdate';
 $res = $this-UsersBook-find('all', $params);
 [..]

 Hope that helps,
 harpax


 On 24 Apr., 16:28, voocake vooc...@gmail.com wrote:
 Hello,

 I have nice SQL query which makes most of the work for me, but i have
 no plan how to convert it to a cakephp conform condition array. I'm
 aware of the possibility to make a custom query, but i'm trying to
 avoid this.

 May someone can help me with this?

 Here is the statement:

 SELECT DATE_FORMAT(created, '%d.%m.%Y') AS sdate, COUNT(savedtime) AS
 saved , COUNT(encashedtime) AS encashed FROM users_books WHERE
 voucher_id IN (8, 124, 120)
 AND created = NOW()
 AND DATE_SUB(NOW(), INTERVAL 30 DAY)
 GROUP BY sdate
 ORDER BY sdate

 Thx
 voocake

 


--~--~-~--~~~---~--~~
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: Web Service

2009-04-24 Thread Dave

Rest is built into CakePHP. http://book.cakephp.org/view/476/REST

We've been investigating Web Services as well, and a Java
implementation performs a lot better than Apache/PHP, although it is a
fair bit more complex to get running. Worth thinking about if it's
going to be a highly loaded service. For a small, infrequently used
one Cake will be fine though, and you'll get it up and running in no
time (I wish Java was as easy!)

On Apr 23, 10:49 am, Rahul Sinhaa rahul...@gmail.com wrote:
 Hello guys ,

 We have to start a new project using cake php framework.
 The project is related to WEB Services.

 We have to create a WEB SERVICE -server , I want you guys to help me
 deciding on the WEB SERVICE method (SOAP, REST ..) since I am not sure
 that which method will be the best match for CAKE PHP and their
 limitations also.

 Thanks in advance

 -Rahul
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Where do I start if I was SQL injected?

2009-04-24 Thread Linas

Excuse me for my lack of knowledge. I've read through discussions on
topic sql injection, and as far as I understood, it is not likely if
you use CakePHP's way of doing things.
However my site was SQL injected. I only write data using the model's
save() method. Where do I start to look for possible flaws? Is Auth
component known to have any? Do you see any flaws in the following
controller's method?

function submit($id = null) {
$this-set('page', 'submit');

if (!empty($this-data)) {
// additional fields
$this-data['Submission']['timestamp'] = date(Y-m-d
H:i:s);
$this-data['Submission']['user_id'] = $this-Auth-user
('id');

$this-Submission-create();
if ($this-Submission-save($this-data)) {
$this-Session-setFlash('Jūsų sprendimas priimtas.');
$this-redirect(array('action'='submissionlist'));
} else {
$this-Session-setFlash('Sprendimo priimti nepavyko.
Pabandykite dar kartą.');
}
}
else if ($id != null) {
$this-data['Submission']['task_id'] = $id;
}
$tasks = $this-Submission-Task-find('list',
array('conditions' = array('Task.published' = 1)));
$this-set(compact('tasks'));
}

I would appreciate any comments.

Linas
--~--~-~--~~~---~--~~
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: Distributing a translation memory of the CookBook

2009-04-24 Thread Pierre MARTIN

Hi nuto,

We also plan to share our French TM across French translators, and I
would be interested in the information you have about it.
Did you find an easy collaborative way for sharing it with a seamless
OmegaT integration?

Thanks in advance for the information you will provide, be sure it
will help us!
Pierre

On 26 fév, 16:00, nuto akaimuras...@gmail.com wrote:
 Hi Gwoo,

 Thank you very much for your reply.
 I will distribute a TM for the Japanesetranslation.
 It will be great help to other translators and Japanese bakers.

 Sincerely yours

--~--~-~--~~~---~--~~
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: MeioUpload Problem

2009-04-24 Thread Arak Tai'Roth

Anyone at all? I could really use some help on this.

On Apr 21, 1:02 pm, Arak Tai'Roth nielsen.dus...@gmail.com wrote:
 Anyone have any ideas on this topic?

 On Apr 20, 5:16 pm, Arak Tai'Roth nielsen.dus...@gmail.com wrote:

  Yup, the exact same permissions as the banners directory

  On Apr 20, 4:09 pm, brian bally.z...@gmail.com wrote:

   Are the permissions for the posters dir good?

   On Mon, Apr 20, 2009 at 4:56 PM, Arak Tai'Roth nielsen.dus...@gmail.com 
   wrote:

So I have my MeioUpload set up:

               var $actsAs = array(
                       'MeioUpload' = array(
                               'banner' = array(
                                       'dir' = 'img/events/banners',
                                       'create_directory' = false,
                                       'allowed_mime' = 
array('image/jpeg', 'image/pjpeg', 'image/
png'),
                                       'allowed_ext' = array('.jpeg', 
'.jpg', '.png'),
                                       'thumbsizes' = array(
                                               'large' = array('width' 
= 950, 'height' = 170)
                                       )
                               ),
                               'poster' = array(
                                       'dir' = 'img/events/posters',
                                       'create_directory' = false,
                                       'allowed_mime' = 
array('image/jpeg', 'image/pjpeg', 'image/
png'),
                                       'alowed_ext' = array('.jpeg', 
'.jpg', '.png'),
                                       'thumbsizes' = array(
                                               'large' = array('width' 
= 300, 'height' = 465)
                                       )
                               )
                       ),
                       'Sluggable' = array(
                               'label' = 'name',
                               'overwrite' = true
                       )
               );

and it works great. However there is one problem, the poster picture
uploads, but no thumbnail is generated. I can't figure out for the
life of my why no thumbnail is generated. My code for the add and edit
views are:

                       echo $form-label('Event.banner', 'Banner:');
                       echo $form-input('Event.banner', array('label' 
= false, 'type' =
'file'));

                       echo $form-label('Event.poster', 'Poster:');
                       echo $form-input('Event.poster', array('label' 
= false, 'type' =
'file'));

So still the same code between them, just different variable names,
yet it doesn't work.

Does anyone have a clue why the banner image would be uploaded and
thumbnailed appropriately, but the poster image wouldn't be?
--~--~-~--~~~---~--~~
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: Where do I start if I was SQL injected?

2009-04-24 Thread Miles J

Doesn't cake stop mysql injection? Its a pretty easy thing to do.

What exactly happened.
--~--~-~--~~~---~--~~
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 not get CakePHP to work with iPhone web app kit iui

2009-04-24 Thread cpeele


Hey guys, I have been trying to get CakePHP to work with the iPhone
web app js and css library iui and always run into problems with it
when it comes to CakePHP finding the files.

I was able to do this without CakePHP. I know it is my lack of
understanding of how best to include a third party js and css library
into CakePHP framework

The iui library consists of some images, js and css files with the
path to the img files hardcoded in the css (i.e. url(myImage.png) ).

To go along with the way CakePHP does things I removed the images from
their image folder within the iui folder and placed them in the img
folder within webroot. I then placed the js and css files in their
respective webroot folders as well.

Then, since the css styles were looking for the image files in the
image folder they came with I had to go and change the path to each
and every style so that they could find the images within the webroot
img folder.

I then referenced the styles and js scripts like so:

?php
$html-css('iui', null, null, false);
$javascript-link('iui', false);
?

When I go to view the page in the browser everything goes blank.
When I view the page source, this is the path to the files it shows:

link rel=stylesheet type=text/css href=/TeamPlayerMobile/css/
iui.css /
script type=text/javascript src=/TeamPlayerMobile/js/iui.js/
script

If anyone could please help I would greatly appreciate it.

Thank you so much!

Chris






--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



file streams in a plugin

2009-04-24 Thread adam

I want to have files in my vendors folder within a plugin and was
wondering what I would supply to fopen for the $include_path to start
a file stream?
--~--~-~--~~~---~--~~
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: CakePHP - MySQL Connection issue

2009-04-24 Thread Sam Sherlock
do you get

Cake is able to connect to the database. (also displayed in a green box)
 if so proceed to the blog tutorial
http://book.cakephp.org/view/219/Blog

search this group when you get in a stitch; refer to book.cakephp.org 
bakery.cakephp.org

- S


2009/4/24 Venki venki.ramanat...@gmail.com

 e fixed the Security.salt issue and renamed the
 database.php.default file to database.php.
 I have also changed the appropriate parameters to connect to my local
 mysql.

 Now my CakePHP welcome page shows only this


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



Re: Using jQuery.ajax - Sending non-forms values to server

2009-04-24 Thread rartavia

In Controller I do $this-Denouncement-saveAll($this-data) and all
saves correctly excepting for one relation: Denouncements hasMany
Sections and Sections hasMay SectionParts.
Sections saved correctly (Denouncement hasMany Section) but
SectionParts are not being saved, i guess because I'm including
SectionParts inside the data[Section] array. But then how can I tell
cake that 'X' SectionPart belongs to 'Y' Section if SectionParts are
outside data[Section] and I dont have Section id yet

The generic explanation: I'm saving to one main table with several
kind of relations by sending all in a single array. One is a nested
relation, 'main table' (denouncements) hasMany other-object (sections)
which hasMany another-object (section_parts). Sending to saveAll in a
single array i'm being able to save on to sections, how should
section_parts should be placed so cake identify to which section they
belong. I hope this is 'understandable' =S

I'm sending to DB:

...
data[Section][0][user_given_name]=asdf
data[Section][0][type]=6
data[Section][0][SectionPart][0][name]=embed
data[Section][0][SectionPart][0][value]=object width=425.../
object
data[Section][0][SectionPart][0][type]=embed
data[Section][0][SectionPart][1][name]=top_left_img
data[Section][0][SectionPart][1][value]=/site/files/
user_uploaded_imgs/
20090423T050438.jpg
data[Section][0][SectionPart][1][type]=img
data[Section][0][SectionPart][2][name]=bottom_left_img
data[Section][0][SectionPart][2][value]=/site/files/
user_uploaded_imgs/
20090423T050439.jpg
data[Section][0][SectionPart][2][type]=img
data[Section][1][user_given_name]=ajksdfljasdfjlh
data[Section][1][type]=0
data[Section][1][SectionPart][0][name]=title
data[Section][1][SectionPart][0][value]=ajksdfljasdfjlh
data[Section][1][SectionPart][0][type]=text
data[Section][1][SectionPart][1][name]=text
data[Section][1][SectionPart][1][value]=ljsa kd ljkasdlkj
data[Section][1][SectionPart][1][type]=text

Sections are saved correctly, however, SectionParts are ignored, no
error nor warning appears

Thanks a lot for any help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth performing logout Without Requesting It

2009-04-24 Thread rartavia

I tried lowering Security.level but still the behavior is:

I login and enter the page, upload an image, reload the page (F5),
window.onbeforeunload event is raised (as I havent saved the
document, images should be erased), jQuery.ajax({url:/
uploaded_images/delete_files/img01.jpg}), AppController before filter
executes ($this-Session-read('Auth.User') appears correctly logged)
delete_files is not executed, page is reloaded. Now, repeating same
steps, this time delete_files executes correctly.
--~--~-~--~~~---~--~~
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: Auth performing logout Without Requesting It

2009-04-24 Thread rartavia

I tried lowering Security.level but still the behavior is:

I login and enter the page, upload an image, reload the page (F5),
window.onbeforeunload event is raised (as I havent saved the
document, images should be erased), jQuery.ajax({url:/
uploaded_images/delete_files/img01.jpg}), AppController before filter
executes ($this-Session-read('Auth.User') appears correctly logged)
delete_files is not executed, page is reloaded. Now, repeating same
steps, this time delete_files executes correctly.
If i logout, again, first time delete_files does not execute, all
following
calls do execute correctly.
--~--~-~--~~~---~--~~
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: Auth performing logout Without Requesting It

2009-04-24 Thread rartavia

I tried lowering Security.level but still the behavior is:

I login and enter the page, upload an image, reload the page (F5),
window.onbeforeunload event is raised (as I havent saved the
document, images should be erased), jQuery.ajax({url:/
uploaded_images/delete_files/img01.jpg}), AppController before filter
executes ($this-Session-read('Auth.User') appears correctly logged)
delete_files is not executed, page is reloaded. Now, repeating same
steps, this time delete_files executes correctly.
If i logout and login, again, first time delete_files does not
execute, all
following calls do execute correctly.
--~--~-~--~~~---~--~~
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: Where do I start if I was SQL injected?

2009-04-24 Thread James K

How do you know it was SQL injection? What exactly happened?

- James

On Apr 24, 5:04 pm, Linas linas.petraus...@gmail.com wrote:
 Excuse me for my lack of knowledge. I've read through discussions on
 topic sql injection, and as far as I understood, it is not likely if
 you use CakePHP's way of doing things.
 However my site was SQL injected. I only write data using the model's
 save() method. Where do I start to look for possible flaws? Is Auth
 component known to have any? Do you see any flaws in the following
 controller's method?

     function submit($id = null) {
         $this-set('page', 'submit');

         if (!empty($this-data)) {
             // additional fields
             $this-data['Submission']['timestamp'] = date(Y-m-d
 H:i:s);
             $this-data['Submission']['user_id'] = $this-Auth-user
 ('id');

             $this-Submission-create();
             if ($this-Submission-save($this-data)) {
                 $this-Session-setFlash('Jūsų sprendimas priimtas.');
                 $this-redirect(array('action'='submissionlist'));
             } else {
                 $this-Session-setFlash('Sprendimo priimti nepavyko.
 Pabandykite dar kartą.');
             }
         }
         else if ($id != null) {
             $this-data['Submission']['task_id'] = $id;
         }
         $tasks = $this-Submission-Task-find('list',
             array('conditions' = array('Task.published' = 1)));
         $this-set(compact('tasks'));
     }

 I would appreciate any comments.

 Linas
--~--~-~--~~~---~--~~
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: Tips for cutting queries and load time?

2009-04-24 Thread James K

You can modelize views just like you can tables. No need for query()

- James

On Apr 24, 1:01 pm, brian bally.z...@gmail.com wrote:
 On Fri, Apr 24, 2009 at 11:10 AM, Martin Westin

 martin.westin...@gmail.com wrote:

  Views, I haven't got my head into yet but it sounds like I probably
  should :)

 Views can make a big difference. Well worth looking into.
 Unfortunately, they require using query(). I thought I saw something
 about being able to query views in 1.3. Or maybe that's just wishful
 thinking. I admit that it's not clear to me how that could be fit into
 Cake in an efficient manner.

  That is a lot of time for so few queries IMHO. Possibly one or a few
  are taking very long because they return many rows. Whenever I return
  more than 20 rows of anything I usually just want to count them or
  somehow pull stats from them.

 There may also be candidates for caching in your data retrieval. Give
 some thought to how often certain queries are made fro a particular
 user. If the data will always be the same, cache it.

 Also, have a look at the queries themselves. For MySQL, in the
 terminal, run EXPLAIN your_query [1] to see whether or not your
 indexes are being used. Note that simply creating a key does not
 guarantee it'll be used. If your query includes a function, for
 instance, your key may be ignored. [2] This is crucial to understand
 if you're concerned about performance.

 [1]http://dev.mysql.com/doc/refman/5.1/en/using-explain.html
 [2]http://www.mysqlperformanceblog.com/2007/10/17/mysql-performance-elim...
--~--~-~--~~~---~--~~
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: Tips for cutting queries and load time?

2009-04-24 Thread James K

I'd look into re-evaluating how you're using ACL. If your ARO/ACO
queries are taking that long you may be relying too heavily on Cake's
built in (and horribly inefficient) ACL implementation.

- James

On Apr 24, 10:08 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I was hoping to get some general tips on how to speed up load time and cut
 down on the number of queries in a request.

 I have for example 18 queries took 123 ms for 1 page. I have been cleaning
 up find queries to use contain and only query fields I need cleaning out
 ones not needed, unbind models in some actions to remove tables not needing
 to get data from on others and in some cases cacheQueries.

 In my 18 queries took 123 ms example there are no describe tables...just
 the ARO/ACO and general queries to grab info for the page. I have not made
 any custom JOINS or anything anywhere in the site, only the ones cake makes
 with its relationship tables.

 Can someone provide info on how to speed things up beyond what I have been
 doing?

 thanks

 Dave
--~--~-~--~~~---~--~~
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: Tips for cutting queries and load time?

2009-04-24 Thread Dave Maharaj :: WidePixels.com

Thanks for all the advice.

The ARO/ACO queries are not the factor in the time its taking so far. Mostly
the requests for the related tables. Going thru unbinding them and that
seems to have helped greatly.

I have the toolbar installed...wondering if all the info in there is also
adding to the time in anyway?

Thanks,

Dave

-Original Message-
From: James K [mailto:james.m.k...@gmail.com] 
Sent: April-24-09 11:00 PM
To: CakePHP
Subject: Re: Tips for cutting queries and load time?


I'd look into re-evaluating how you're using ACL. If your ARO/ACO queries
are taking that long you may be relying too heavily on Cake's built in (and
horribly inefficient) ACL implementation.

- James

On Apr 24, 10:08 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I was hoping to get some general tips on how to speed up load time and 
 cut down on the number of queries in a request.

 I have for example 18 queries took 123 ms for 1 page. I have been 
 cleaning up find queries to use contain and only query fields I need 
 cleaning out ones not needed, unbind models in some actions to remove 
 tables not needing to get data from on others and in some cases
cacheQueries.

 In my 18 queries took 123 ms example there are no describe 
 tables...just the ARO/ACO and general queries to grab info for the 
 page. I have not made any custom JOINS or anything anywhere in the 
 site, only the ones cake makes with its relationship tables.

 Can someone provide info on how to speed things up beyond what I have 
 been doing?

 thanks

 Dave


--~--~-~--~~~---~--~~
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: Translate Behavior

2009-04-24 Thread Henrique Machado
Thank you!

Is that =)



Henrique Machado



2009/4/24 jitka (poLK) slunii...@gmail.com


 $label = __('Title', true);
 echo $form-input('Post.title.cze', array('type' = 'text', 'label' =
 $label . ' (cze)'));
 echo $form-input('Post.title.eng', array('type' = 'text', 'label' =
 $label . ' (eng)'));

 


--~--~-~--~~~---~--~~
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: naming conventions help

2009-04-24 Thread mark_story

You have the $name set wrong on your controller.  Should be
'Departments' not 'Department'.  If you are on PHP5 you don't need to
specify $name either.

-Mark

On Apr 24, 8:19 am, forrestgump vikhya...@gmail.com wrote:
 hey guys,
  I ran into a problem with the model and table naming conventions

 I have the following:

 1)model: department.php :-
 ?php
 class Department extends AppModel
 {

   var $displayField = 'department';
       var $useTable = false;}

 ?

 2)contoller: deparments_conrtoller.php :-
 ?php
 class DepartmentsController extends AppController {
    function index()
    {
        $name = 'Department';
    }}

 ?

 3)View folder: departments and index.php:-
  TEST!!!

 here is the problem when i view the page (appname)/deparments i get
 TEST!!! as expected.i created a table called departments with
 fields id,departmentand i commented the line var $useTable =
 false; in deparment model.now i get an error which says:

 Not Found

 Error: The requested address '/departments' was not found on this
 server.

 Can someone tell me what iam doing wrong im guessing it is in my
 naming conventions...can someone correct me?
 will appreciate any help.

 Regards,
 Forrestgump
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



finderQuery question

2009-04-24 Thread Dave Maharaj :: WidePixels.com

I am new at this and learning new things all the time and trying them out..
I came across finderQuery and was wondering if i set up the finderQuery in a
model such as this example I found online
 
'finderQuery' = 
SELECT . 
Airport.id, . 
Airport.name, . 
Airport.city, . 
Airport.identifier, . 
COUNT(Change.id) AS
changes, . 
State.abbrev . 
FROM . 
airports AS Airport . 
JOIN states AS State ON 
(Airport.state_id = State.id) . 
LEFT JOIN changes AS
`Change` ON 
(`Change`.airport_id = Airport.id) . 
JOIN books_airports ON
(Airport.id 
= books_airports.airport_id) . 
WHERE . 
'books_airports.book_id = 
{$__cakeID__$}'. 
GROUP BY Airport.id  
) 
) 
 
 
This gets me all the info in 1 queryperfect. But if I needed to find say
just the 
Airport.id, . Airport.name, .  Airport.city, . Or add an additional
field such as Airport.int_code, . to get data from on a different page
would I use a custom find('list', array('conditions'..)):

And would that only pull the info requested or will it tie into the
finderQuery and pul lall that data?

Find would get me all the info from the finderQuery and find('list/first??',
array('conditions'..)): would let me over ride the finderQuery?

Thanks,

Dave


--~--~-~--~~~---~--~~
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: Tips for cutting queries and load time?

2009-04-24 Thread brian

On Fri, Apr 24, 2009 at 9:21 PM, James K james.m.k...@gmail.com wrote:

 You can modelize views just like you can tables. No need for query()


Care to give a hint?

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



Re: Plugin for MySQL Workbench: Who to contact?

2009-04-24 Thread Gwoo

The plugin is very new, seeing as how i finished it last week. It was
working fine for me and jperras, but it was only tested on OSX. Maybe
you are referring to the save to file, which requires more work since
workbench has not open the API to the save dialog. When they add that
it will be updated. For now the easiest thing to do is copy to
clipboard and paste it in your favorite text editor.

Anyway, if you actually provide some information about what is not
working, then I might be able to help.

Happy Baking.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Website on computer works, when on ftp it doesn't

2009-04-24 Thread simon...@gmail.com

Good Evening,

I did create my website using cakephp on Windows XP with Xampp. It was
working perfectly.

Then I did send all the files to my ftp and for some reason there is a
problem that I've not found the answer yet.


You can see the error at this adress:

http://simonjpa.olimpia.kinghost.net/phpinfo.php


I don't know if I forgot to configure something on the server.



--~--~-~--~~~---~--~~
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 not get CakePHP to work with iPhone web app kit iui

2009-04-24 Thread Teh Treag

Chris,

I use iui on one of my sites. Your description of your install sound
ok. Are the uris to the files correct?  Iui is a little quirky, I
would sugguest you temporarily elimate cakephp as potentially part of
the problem and try a static HTML/php page in $app/webroot. once you
can confirm that works, then you can try the integration with
cakephp.

I do have a page using cakephp and iui. http://iheartstar.com

BTW - I don't use iui for new development.

-teh

On Apr 24, 5:40 pm, cpeele chris.peel...@gmail.com wrote:
 Hey guys, I have been trying to get CakePHP to work with the iPhone
 web app js and css library iui and always run into problems with it
 when it comes to CakePHP finding the files.

 I was able to do this without CakePHP. I know it is my lack of
 understanding of how best to include a third party js and css library
 into CakePHP framework

 The iui library consists of some images, js and css files with the
 path to the img files hardcoded in the css (i.e. url(myImage.png) ).

 To go along with the way CakePHP does things I removed the images from
 their image folder within the iui folder and placed them in the img
 folder within webroot. I then placed the js and css files in their
 respective webroot folders as well.

 Then, since the css styles were looking for the image files in the
 image folder they came with I had to go and change the path to each
 and every style so that they could find the images within the webroot
 img folder.

 I then referenced the styles and js scripts like so:

 ?php
         $html-css('iui', null, null, false);
         $javascript-link('iui', false);
 ?

 When I go to view the page in the browser everything goes blank.
 When I view the page source, this is the path to the files it shows:

         link rel=stylesheet type=text/css href=/TeamPlayerMobile/css/
 iui.css /
         script type=text/javascript src=/TeamPlayerMobile/js/iui.js/
 script

 If anyone could please help I would greatly appreciate it.

 Thank you so much!

 Chris
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



contain HABTM

2009-04-24 Thread Dave Maharaj :: WidePixels.com
Can someone help me with a contain using a HABTM relationship.
POSTS HABTM SUBJECTS
SUBJECTS 
POSTS_SUBJECTS
 
I have Post HABTM SUBECTS 
 
I just want to print out the array of SUBJECTS that the POST has.
 
I managed to get the rest of the contain for the other hasmany tables...just
cant get the HABTM
 
Thanks
 
Dave 

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Query question

2009-04-24 Thread Dave Maharaj :: WidePixels.com
Just doing some messing around on a site and playing with contain vs.
$this-model-read($id).
 
When I leave the controller to read the $id SQL Queries = 6
 
but contain spits out 8.
 
Now the 6 queries was 2010 characters in length while the 8 queries was 400
less at 1600 characters. My question...is it better to have fewer longer
queries or more shorter queries when it comes to speed?
 
Both were very similar in time but then there is only me testing the site
now...thinking what is best in a real  live production environment?
 
I will be containing more queries on other controller and it just happened
to be that  there were more for this particular one...might be less on
others but just wanted to hear some general feedback from people who have
more experience with Cake.
 
thanks,
 
Dave 

--~--~-~--~~~---~--~~
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: Query question

2009-04-24 Thread brian

I don't think the number of characters in a query makes too much
difference. Not compared to how the query is formulated, in any case.
It's also not so much a Cake thing as between your DB and its PHP
wrapper. But, again, it's likely the least thing to be concerned
about.

On Fri, Apr 24, 2009 at 11:59 PM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Just doing some messing around on a site and playing with contain vs.
 $this-model-read($id).

 When I leave the controller to read the $id SQL Queries = 6

 but contain spits out 8.

 Now the 6 queries was 2010 characters in length while the 8 queries was 400
 less at 1600 characters. My question...is it better to have fewer longer
 queries or more shorter queries when it comes to speed?

 Both were very similar in time but then there is only me testing the site
 now...thinking what is best in a real  live production environment?

 I will be containing more queries on other controller and it just happened
 to be that  there were more for this particular one...might be less on
 others but just wanted to hear some general feedback from people who have
 more experience with Cake.

 thanks,

 Dave
 


--~--~-~--~~~---~--~~
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: Website on computer works, when on ftp it doesn't

2009-04-24 Thread brian

Well, the error msg is pretty clear. It looks to me like you forgot to
change the CAKE_CORE_INCLUDE_PATH define in webroot/index.php. Your
server isn't a Windows box.

On Fri, Apr 24, 2009 at 10:35 PM, simon...@gmail.com simon...@gmail.com wrote:

 Good Evening,

 I did create my website using cakephp on Windows XP with Xampp. It was
 working perfectly.

 Then I did send all the files to my ftp and for some reason there is a
 problem that I've not found the answer yet.


 You can see the error at this adress:

 http://simonjpa.olimpia.kinghost.net/phpinfo.php


 I don't know if I forgot to configure something on the server.



 


--~--~-~--~~~---~--~~
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: contain HABTM

2009-04-24 Thread brian

This doesn't work?

$this-find(
'first',
array(
'conditions' = array(
'Post.id' = $post_id
),
'contain' = array(
'Subject'
)
)
);

On Fri, Apr 24, 2009 at 11:30 PM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Can someone help me with a contain using a HABTM relationship.
 POSTS HABTM SUBJECTS
 SUBJECTS
 POSTS_SUBJECTS

 I have Post HABTM SUBECTS

 I just want to print out the array of SUBJECTS that the POST has.

 I managed to get the rest of the contain for the other hasmany tables...just
 cant get the HABTM

 Thanks

 Dave
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Flex - cakePHP - database. What are pros cons ?

2009-04-24 Thread Raja

Hi,

I am evaluating flex - PHP - database for porting a desktop C/S
application
to web. We just completed test application accessing firebird database
with
amfPHP. Some ppl suggested us to wrap database layer in some server
side
PHP framework like cakePHP. We are also aware that there is flavor of
amfPHP
for cakePHP like cakeAmfPHP. Since this is our first web application
we are not
able to judge the gravity of this suggestion.

Can somebody tell us what are pros and cons of using cakePHP in
between.
We will be using only services to access data from flex. There will
not be
any PHP/HTML forms/views attached to database. At later stage we may
shift
to AIR if its appropriate but as of today we dont have any plans to
develop
conventional HTML based browser application.

Thanks and best regards

Raja

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---