Re: cant remove page from url pagination to prevent error

2015-02-18 Thread ajt
You mean use get instead of post? > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails f

Cakephp 3 : use of "$this->alias()" in "where" conditions

2015-02-18 Thread Pgbi
Hi, To avoid the "Column 'xxx' in where clause is ambiguous" error when making queries involving multiple tables sharing the same name for a given column, I now systematically include $this->alias() in where conditions : $table->find()->where([$table->alias() . '.foo' => 'bar']); Is this cons

Re: cant remove page from url pagination to prevent error

2015-02-18 Thread euromark
Are you by any chance mixing named params and query strings? you shouldnt do that. It is best to completely drop named params, and instead use query strings completely. I know for a fact that it all works then just fine :) See www.dereuromark.de/2013/05/04/passed-named-or-query-string-params/ Mar

cant remove page from url pagination to prevent error

2015-02-18 Thread ajt
Hi, In cakephp I keep getting a page out of range error. The problem only happens when I am page:2 or above and I perform a search. The search works fine unless this is only 1 page found and then I get the error if the URL has page 2 or above. I tried resetting the page no, to 1 and

Re: Correct model associations

2015-02-18 Thread gt0p
I sorted it out by using the HasMany thorough relation and by correcting the $data feed. On Friday, February 6, 2015 at 8:46:08 PM UTC, gt0p wrote: > > I am trying to bind 3 tables and I am having problems with proper > relations. > Table users (pk id), books (pk id), users_books (user_id, book

Re: DOMDocument doesn't work in a controller

2015-02-18 Thread Daniel Schalla
Are you calling it with "new DomDocument" or "new \DomDocument"? Since DomDocument is in the Root Namespace, you have to add the "\" at the beginning or define DomDocument using the "use \DomDocument;" statement. If that's not the case, please show us some code. (http://gist.github.com) Am Fre

hasOne and SaveAll

2015-02-18 Thread gt0p
I am trying to bind it all, but I am having issues with the final dataset. I use a complex query to save data but it looks like nothing gets stored for following association. USER: public $hasOne = array( 'Profile'); PROFILE: public $belongsTo = array('User'); $data = ['

3.0 Upgrade Tool not updating files

2015-02-18 Thread James H
Morning, I've ran a few passes with the upgrade tool on a cake 2 project and have found the running bin/cake upgrade all /var/www/app my Model files are not relocated. Running through the various upgrade commends individually does relocate my Models. That i

use App\Controller\AppController;

2015-02-18 Thread James H
Hi All, Cake 3.0. When is/isn't use App\Controller\AppController; required in a controller? The blog tutorial does not use it, some of the examples on the controllers page use it, but not all. Can anyone explain exactly when his is needed please? Thanks -- Like Us on FaceBook https://www.fa

[3.0] Validation, how to replace beforeValidate

2015-02-18 Thread RobertMei
Hi Until beforeValidate has been removed i kept logic like this in beforeValidate public function beforeValidate(Event $event, Entity $entity) { if( $entity->isNew() ) { $businessType = $entity->customer->businessType; if( $businessType == BusinessType::BUSINESS_TYPE_PERSON ) $entity->b2_type

File upload failure to cakephp

2015-02-18 Thread chaitanya kiran
Hi Grourp, I m newbie to the CakePHP, trying to upload xlsx file to CakePHP Below is my view code Form->create('Program', array('action' => 'importexcel', 'type' => 'file')); echo $this->Form->file('Document'); echo $this->Form->submit(__('Upload', true));

I m trying to upload xlsx file in cakePHP

2015-02-18 Thread chaitanya kiran
Hi Group, I m trying to upload xlsx file in CakePHP view code Form->create('Program', array('action' => 'importexcel', 'type' => 'file')); echo $this->Form->file('Document'); echo $this->Form->submit(__('Upload', true)); ?> With the below code in controller function

Re: empty controller/component directory

2015-02-18 Thread vampke
Hi john, Thanks for your reply. I don't understand: I have downloaded different version and this directory is always empty. Could anyone be so kind to share the content of this directory? v. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP

Re: empty controller/component directory

2015-02-18 Thread vampke
appologies, I only now realize they are NOT in app/controller/component, but in the directory you mention. Are these files supposed to be copied to app/controller/compoment? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received t

Re: Correct model associations

2015-02-18 Thread gt0p
I already missed one valid model association - has many through, and that solved my issue. Thanks anyway for the reply! On Monday, February 9, 2015 at 5:25:58 PM UTC, John Andersen wrote: > > Assuming you are using CakePHP 2.x > > It is a good idea to define a primary key in your HABTM table - in