Wednesday, December 30, 2015

MySQL View for Reporting

Hi all,

I am newbie to the Cake.
I would like to know whether there is a way to query MySQL View with the Cake.
Any ideas?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Tuesday, December 29, 2015

CakePHP 3.1.1 - deleteAll when using condition NOT IN array fails

Hello,

A function in OpSpTable.php uses the following code:

            $op_id = 18;
            $actualUsed = [2, 101];
 
            $conditions = [
                'OpSps.op_id'             => $op_id,
                'OptSps.ec_id NOT IN' => $actualUsed,
            ];

            $results = $this->deleteAll($conditions);

 
The exception thrown is about MySQL not understanding what's going on at '1)'

To fix the issue temporarily, I have done a query to get an array of OpSps.oc_id and then performed a loop with ->get and then ->delete.  But this seems like overkill.  Is there something wrong with the use of NOT IN withing the deleteAll?

Thanks for any input... I've worked around the issue, but don't understand why I had to?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

hasmany validation and save data in a form, best approach

hello,
lets say that i have a form that represents an invoice and the invoice items. the invoice has many invoice items relation.
the form has some inputs for the invoice, and 10 rows with inputs for the invoice items: item code, item qty, item price, etc...
Not always all the 10 rows are filled with invoice items and you do not wants that the validation rules be applied to these rows that are not used.
the question is, what is the best approach to accomplish this?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Help with Cakephp 2.x pagination

Thanks @John

On Tue, Dec 29, 2015 at 8:53 AM, John Andersen <j.andersen.lv@gmail.com> wrote:
As Matthew wrote, use the Neighbor function. See the CakePHP book in this page:
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#find-neighbors

Enjoy, John


On Tuesday, 29 December 2015 00:54:37 UTC+2, Clement Crownrise wrote:
Thanks for your response, but please what is the neighbour function?

Can you please paste the sytax here.

Thanks


On Monday, December 28, 2015 at 11:35:36 PM UTC+1, Matthew Kaufman wrote:
Use the get neighbors function.

On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise <clementc...@gmail.com> wrote:
Hello everyone, below is the first page of my list page, The first attachment..

On clicking on any of the data on the first page, it will open up and show like the second attachment.

Now the problem is, I want to add a "Next " and "Previous" button to the second attachment, so that I will not need to go to the first page(first attachment ) in order to access the next or previous record.

HOW CAN I ACHIEVE THIS?

--
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 from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
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 a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/HYSgunvislo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.



--

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

CakePHP 3 - Catch invalidargument email -> to exception


How can we catch an invalid email exception? Cake throws and invalidargumentexception. 



Invalid email: "bassdsd.cs#adcdc.com"InvalidArgumentException



This does not work, the catch is not reached:

$toEmailAddress = "bassdsd.cs#adcdc.com";

$email = new Email('default');

try
{
    $email->to($toEmailAddress);
}
catch(InvalidArgumentException $ex)
{
   // error
}


--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Monday, December 28, 2015

Re: Help with Cakephp 2.x pagination

As Matthew wrote, use the Neighbor function. See the CakePHP book in this page:
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#find-neighbors

Enjoy, John

On Tuesday, 29 December 2015 00:54:37 UTC+2, Clement Crownrise wrote:
Thanks for your response, but please what is the neighbour function?

Can you please paste the sytax here.

Thanks


On Monday, December 28, 2015 at 11:35:36 PM UTC+1, Matthew Kaufman wrote:
Use the get neighbors function.

On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise <clementc...@gmail.com> wrote:
Hello everyone, below is the first page of my list page, The first attachment..

On clicking on any of the data on the first page, it will open up and show like the second attachment.

Now the problem is, I want to add a "Next " and "Previous" button to the second attachment, so that I will not need to go to the first page(first attachment ) in order to access the next or previous record.

HOW CAN I ACHIEVE THIS?

--
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 from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Help with Cakephp 2.x pagination

Thanks for your response, but please what is the neighbour function?

Can you please paste the sytax here.

Thanks


On Monday, December 28, 2015 at 11:35:36 PM UTC+1, Matthew Kaufman wrote:
Use the get neighbors function.

On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise <clementc...@gmail.com> wrote:
Hello everyone, below is the first page of my list page, The first attachment..

On clicking on any of the data on the first page, it will open up and show like the second attachment.

Now the problem is, I want to add a "Next " and "Previous" button to the second attachment, so that I will not need to go to the first page(first attachment ) in order to access the next or previous record.

HOW CAN I ACHIEVE THIS?

--
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 from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Help with Cakephp 2.x pagination

Use the get neighbors function.

On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise <clementcrownrise@gmail.com> wrote:
Hello everyone, below is the first page of my list page, The first attachment..

On clicking on any of the data on the first page, it will open up and show like the second attachment.

Now the problem is, I want to add a "Next " and "Previous" button to the second attachment, so that I will not need to go to the first page(first attachment ) in order to access the next or previous record.

HOW CAN I ACHIEVE THIS?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Help with Cakephp 2.x pagination

Hello everyone, below is the first page of my list page, The first attachment..

On clicking on any of the data on the first page, it will open up and show like the second attachment.

Now the problem is, I want to add a "Next " and "Previous" button to the second attachment, so that I will not need to go to the first page(first attachment ) in order to access the next or previous record.

HOW CAN I ACHIEVE THIS?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Route is overwriting routes of same controller

Is it right that all other routes of the same controller are overwritten if I define the following?

Router::connect(
    '/catalogs/:name',
    ['controller' => 'catalog_groups', 'action' => 'view'],
    ['name' => '[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*']
);

I am using CakePHP 2.7.*

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Thursday, December 24, 2015

How to force DebugKit to use HTTPS for its requests?

Apps running on Heroku can be requested via HTTPS even though the app and Web server don't know anything about it. Apps behind CloudFlare have a similar option.

In this environment, DebugKit may be blocked as "mixed content" because the request for it happens via HTTP. My browser (Firefox 43) says this:

Blocked loading mixed active content "http://myappname.herokuapp.com/debug_kit/toolbar/27dac57d-6616-4450-8926-ee75512bde70"      toolbar.js:53:2

What would be the preferred method of forcing DebugKit to use HTTPS in its base URL? When I look at the page source, I find this element:

<script id="__debug_kit" data-id="927dac57d-6616-4450-8926-ee75512bde70" data-url="http://myappname.herokuapp.com/" src="/debug_kit/js/toolbar.js"></script>

It seems I either need to force the protocol in the "data-url" attribute, or else configure it to ignore the base URL and to try loading the path from "src" relative to the browser's notion of the base URL.

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Wednesday, December 23, 2015

CakePHP 3.1.6 Released


The CakePHP core team is happy to announce the immediate availability of CakePHP 3.1.6. This is a maintenance release for the 3.1 branch that fixes several community reported issues.

Bugfixes
--------

You can expect the following changes in 3.1.6. See the [changelog](http://cakephp.org/changelogs/3.1.6) for every commit.

* The `Auth.afterIdentify` event is now triggered for stateless
  authentication.
* `Query::offset()` now marks a query as modified.
* Calling `find()` on a BelongsToMany association now joins the junction
  table. This allows association conditions to be applied to queries.
* Redis DSN parsing was fixed.
* `FormContext::errors()` now handles nested validation errors.
* The `existsIn()` rule now uses an association's `bindingKey` option.
* `requestAction()` now passes cookies to the sub-request as documented.
* `FormHelper` now treats string integer values as UTC timestamps. This mirrors how
  it handles integer values.
* `FormHelper` now correctly generates name attributes for dot pathed field
  names that end in `[]`.
* A memory leak in `ORM\ResultSet` has been fixed.
* `DashedRoute` now correctly handles vendor prefixed plugin names.
* CORS domain handling is more robust and less permissive.
* Postgres index reflection is more robust and can handle complex index
  definitions.
* Postgres schema reflection more accurately defines SERIAL columns.
* Pagination of complex queries using expressions in their ORDER clause no
  longer fail.
* `File` can now open `file://` paths on windows.
* `bin/cake i18n init` now preserves the locale case.

Minor Enhancements
------------------

* Session configuration now better handles environments where runtime
  modification of session configuration is not allowed.
* The `phpdbg` SAPI is treated the same as CLI.
* CompletionShell suggests task and shell names based on short forms. It can
  also suggest option names for subcommands and tasks now.
* Compatibility with PHPUnit 5 was improved.
* `Query::removeJoin()` was added. This method can be used to remove joins
  from a query by join alias.
* `View::reset()` was added. This method lets you reset the contents of a view
  block.

As always, a huge thanks to all the community members that helped make this release happen by reporting issues and sending pull requests.

Download a [packaged release on github](https://github.com/cakephp/cakephp/releases).

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Access development server from another (local) computer

Use ngrok. https://ngrok.com/. 
After you install it, you type `ngrok 8765` from a command prompt and it will provide you with a URL you can use to access your Cake app from another computer inside or outside your local network. 


On Tuesday, December 22, 2015 at 5:39:13 AM UTC-5, Ken Hargy wrote:
I'm new to CakePHP so maybe I'm missing something obvious... I set everything up as expected and I ran:

bin/cake server

everything works fine if I go to http://localhost:8765, but I want to access it on another computer on my local network. It seems like it's not allowing connections other then localhost to port 8765.

Is there a setting for that somewhere?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Tuesday, December 22, 2015

cakephp 3 Insert with Query Builder update Timestamp fields

Using the query builder to insert multiple rows of data the timestamp fields are not automatically updated, is this correct? 

so i changed my code a little to add the fields myself. Not sure if this is the best way or am i missing something


$oQuery = $this->query();

if (($handle = fopen($tmpFilename, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
$num = count($data);
if ($linenumber == 1) {
for ($c = 0; $c < $num; $c++) {
$columnnames[] = $data[$c];
}
} else {
for ($c = 0; $c < $num; $c++) {
$line['csv_file_id'] = $csvFileId;
$line['linenumber'] = $linenumber;
$line['columnname'] = $columnnames[$c];
$line['columndata'] = $data[$c];
$line['created'] = date('Y-m-d h:m:s');
$line['modified'] = date('Y-m-d h:m:s');

$oQuery->insert(['csv_file_id', 'linenumber', 'columnname', 'columndata','created','modified'])
->values($line);
}
}
$linenumber++;
}
fclose($handle);

$oQuery->execute();

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Access development server from another (local) computer

That question is not really related to CakePHP.

Depending on your setup, you will have to open the firewall on the computer, where you have your site running. You will probably also have to configure your webserver (apache, nginx, etc.) to accept connections from other IP addresses than localhost.

Tell what you have tried and how far you got :)
Enjoy, John

On Tuesday, 22 December 2015 12:39:13 UTC+2, Ken Hargy wrote:
I'm new to CakePHP so maybe I'm missing something obvious... I set everything up as expected and I ran:

bin/cake server

everything works fine if I go to http://localhost:8765, but I want to access it on another computer on my local network. It seems like it's not allowing connections other then localhost to port 8765.

Is there a setting for that somewhere?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

how to deploy i18n translations ?

In my development environment the I18n works fine, i can set the locale with both ini_set('intl.default_locale', 'pt_BR') and I18n::locale('pt_BR').

But on my server nothing seems to work.
Permissions are fine, cakephp can read the src/Locale files and write cache files on tmp/cache/persistent.
In fact cakephp do write the translated cache file
$ cat tmp/cache/persistent/app_cake_core_translations_default_pt_br
1450793103
O:20:"Aura\Intl\Translator":4:{s:11:"*fallback";N;s:12:"*formatter";O:32:"Cake\I18n\Formatter\IcuFormatter":0:{}s:9:"*locale";s:5:"pt_br";s:11:"*messages";a:0:{}}

I my environment the *messages has all the translations while server none.

What else could be the problem? I don't know what else can i do.

Thanks.

Alysson Gonçalves de Azevedo

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP 3 Shell arguments and options

See the existing core shells for details.
They use it quite a bit.

Tip: ConsoleOptionParser

Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb Martina Weinzettelova:
Hello

I cant find in docummentation how can i access passed argumet and options in shell function.

bin/cake myshell function --option value

How can i read --option ???

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: How to unset field value of a post edit view

You need to be more specific.
Also, your forms should always preserve the correct state on post, and should preset on get with DB values etc.

Failing to do so will get you in trouble.
Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb Amit Gora:
i am using checkbox array in my form and save their values "," separated in database. so when i go into edit view of this post then it`s get default value of field which is set by controller so i want to disable it for some fields. how i can do it??

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: how to connect a simple registration form with mysql

Please see the tutorials in the docs.

Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb kumar pkvel:
i want to connect a registration form am a beginner  i need to connect in xampp cake php version3.1.2

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Unable to delete first record using postLink()

You already answer yourself: Forms in forms is invalid.
The docs tell you what to do, use a block to capture the forms of the postLink() and output it after you closed the form.

Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb Jaspreet Sarao:
Hello, I am new to cakephp..

I have used postLink() to delete the records. On a page, I am unable to delete first record using postLink(). I have used postLink() after $this->Form->create.

<code>
$this->Form->postLink($image1, array(
'action' => 'delete',
$item[$modelClass]['id'],
), array('escape' => false), __('Are you sure?'));

</code>

Can anybody help me?


--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Cake php 3.0

Bruna, você pode incluir no seu router.php a configuração da rota padrão.

http://book.cakephp.org/3.0/en/development/routing.html#quick-tour


On Tue, Dec 22, 2015, 08:39  <bruna@qtsolucoes.com.br> wrote:
Boa tarde..estou usando o cake php 3.0,no meu localhost a aplicação ja esta pronta quando entro no navegador e digito:localhost/projeto/users/login aparece o login,so que la no meio do projeto o usuario digita no navegador::localhost/projeto/ aparece a pagina de inicial do cake alguem sabe como mudar isso,fazer um redirecionamento para algum controller..

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Monday, December 21, 2015

CakePHP 2.7.8 released

The CakePHP core team is happy to announce the immediate availability of CakePHP 2.7.8. This is a maintenance release for the 2.7 branch that fixes several community reported issues.

Bugfixes
--------

You can expect the following changes in 2.7.8. See the [changelog](http://cakephp.org/changelogs/2.7.8) for every commit.

* An extract() call was removed from Validation::comparison(). There was some  concern that it could be used to circumvent validation.
* Fixed issue around incorrect SNI validation when host name contains protocol for SmtpTransport.
* Proxy Authentication with SSL no longer forwards proxy credentials in  HttpSocket.
* SchemaSchell clears the ClassRegistry after applying schema.
* Context is reset when parsing MO files. Previously context could bleed between  message identifiers.

As always, a huge thanks to all the community members that helped make this release happen by reporting issues and sending pull requests.

Download a [packaged release on github](https://github.com/cakephp/cakephp/releases).

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Cakephp Unit testing:using fixtures in components

Hi,
Iam writing test cases for one component ,need to use fixtures in compoment.
my code is
Class SampleComponentTest extends TestCase
{
    public $component = null;
    public $controller = null;
    public $fixtures = ['app.cities','plugin.sampleplugin.states'];
    public function setUp()
    {
        parent::setUp();
        $request = new Request();
        $response = new Response();
        $this->controller = $this->getMock(
            'Cake\Controller\Controller',
            [],
            [$request, $response]
        );
        $registry = new ComponentRegistry($this->controller);
        $this->component = new SampleComponent($registry);
    }
}
And i need to use two fixtures ,one is from app and another is from plugin.
when i run the code i got followign exception
"Exception: Referenced fixture class "SamplePlugin\Test\Fixture\StatesFixture" not found. Fixture "plugin.sampleplugin.states" was referenced in test case "App\Test\TestCase\Controller\Component\SampleComponentTest". in [D:\Projects\xampp\htdocs\testapp\vendor\
cakephp\cakephp\src\TestSuite\Fixture\FixtureManager.php, line 213]".

please provide the solutions to that how to use fixtures in component with sample code/
doubts
1)$this->component is mock object or direct object>
2)what is second parameter of getMock() method(if i provide empty it giving the error,above i replaced with empty)
3)

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Friday, December 18, 2015

CakePHP 3 Shell arguments and options

Hello

I cant find in docummentation how can i access passed argumet and options in shell function.

bin/cake myshell function --option value

How can i read --option ???

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Controller does not load automatically models in plugin (Cake 2.7.5)

The title already speaks exactly my problem. 

The controller does not load the standard model in the Plugin. I have to do manually. 

Including adding the word "Model " on the App::uses() , if not does not work.

e.g.: App::uses("ContactModel", "PluginName.Model")

If I insert just App::uses("Contact", "PluginName.Model"), not working.


Can someone help me?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Thursday, December 17, 2015

how to select special fields in query in cakephp 3

Hi chums :]

I am very new on cakephp.  I've asked this question in stackoverflow , but nobody could not help.
Well, I am here to help me.


I need to join 3 tables (movies, comments, users) in my cakephp 3 controller and select only some special fields. I tested different solutions. I surfed a lot, but I could not solve it. Actually I need to show the last 3 comments on member profile.


Below is controller :

$movietbl = TableRegistry::get('Services.Movies');          $movies = $movietbl->find()                  ->contain([                      'Comments' => function($q) {                          return $q->autoFields(false)                                  ->select([ 'id' , 'title' , 'comments']);                      },                      'Userscomments' => function($q) {                          return $q->autoFields(false)                                  ->select(['lname', 'fname', 'id']);                      }])                          ->where(['Movies.user_id' => $this->getUserId()])                          ->limit(3);                  $this->set('movies', $movies);                  $this->set('userId', $this->getUserId());


below is MoviesTable

$this->belongsToMany('Userscomments', [              'className' => 'Services.Users',              'joinTable'=>'comments',              'foreignKey' => 'movie_id',              'targetForeignKey' => 'user_id',          ]);      }


but it returns all of fields. What should I do now?

Thanks in advance

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Access development server from another (local) computer

I'm new to CakePHP so maybe I'm missing something obvious... I set everything up as expected and I ran:

bin/cake server

everything works fine if I go to http://localhost:8765, but I want to access it on another computer on my local network. It seems like it's not allowing connections other then localhost to port 8765.

Is there a setting for that somewhere?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

how to connect a simple registration form with mysql

i want to connect a registration form am a beginner  i need to connect in xampp cake php version3.1.2

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Tuesday, December 15, 2015

Cake php 3.0

Boa tarde..estou usando o cake php 3.0,no meu localhost a aplicação ja esta pronta quando entro no navegador e digito:localhost/projeto/users/login aparece o login,so que la no meio do projeto o usuario digita no navegador::localhost/projeto/ aparece a pagina de inicial do cake alguem sabe como mudar isso,fazer um redirecionamento para algum controller..

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Monday, December 14, 2015

ROUTER for friendly URL

Redid a website for a client in Cake 2.X and the current site (made native in PHP) has a BD with friendly URLs, something like: city/typestore/name-of-shop. Obviously the HTACCESS is set to receive and treat URLs and "play" the content accordingly.

In the new application (in CakePHP) what I did was this: stores/show/123. Those who understand Cake know it's the controller/action/parameter. The 123 is the ID that step as a parameter.

In the table of the site I have some columns as friendly Url and shop ID (in the example above would be 123)

How can I link these two information, ie, accessing the friendly URL I play ROUTE in the controller, action, and parameter (ID) correctly, pulling the BD (for ID only)?

NOTE 1: It is noteworthy that the new application does NOT have direct access to the database. It's all Web service/API. I have a method layout where I send the URL and it returns ID. Send ID return URL. I also have the programmer's API willingness to create what it takes to succeed.

NOTE 2: The call to the store have to be stores/show/SHOP_ID

Can someone help me?

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Friday, December 11, 2015

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

I debugged it and discovered that sort options must be white listed if they are not part of the model.
I missed that in the documentation...


On Saturday, December 12, 2015 at 4:37:26 AM UTC+7, heavyKevy wrote:
Upon further examination, it works correctly for users, but fails for players....

On Saturday, December 12, 2015 at 4:08:21 AM UTC+7, heavyKevy wrote:
Sorry, I just updated to the latest 3.1.5,

after clicking the weight link.
while the browser is showing the same link: http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
I would expect the new generated link to show desc...
It is not working correctly for me.
--Kevin

On Saturday, December 12, 2015 at 2:04:11 AM UTC+7, euromark wrote:
What "is" your latest cake3 release?
Are you referring to 3.0 or 3.1?

I highly doubt that, there are tests for this behavior.
Are there any links outputted at all?
What do they say?
You need to be more exact in your statements, or it is hard to say anything here.

mark



Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy:
my index method has the following baked code.
$this->paginate = [
            'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions']
        ];
    $this->set ( 'players', $this->paginate ( $this->Players ) );

And my index.ctp is the standard baked template with the following sort link:
  <th><?= $this->Paginator->sort('username') ?></th>

According to the documentation, if I click the title Username, it should default to ASC, then Alternate between ASC and DESC.
Mine never alternates...

--
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 from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.