Category: Routing

In Cakephp 3, how to detect user from another site?

I want to have a method before AppController (beforeFilter) to detect if a user has come to my site via another site. If so, from another site, the method will redirect them to a welcome page. &n

SOLVED #detect #url #domain
2 Answers

Category: Utility Classes

How to implement the built-in mobile detect in Cakephp 3?

I have used mobile detect library (http://mobiledetect.net) before in other php project to determine a request is from a mobile device. Not until recently I noticed Cake 3 has built-in library in boot

SOLVED #mobiledetect #detectors
1 Answers

Category: Configuration

Any thoughts on speeding up Cakephp 3?

I have tried to use caching (cake's default cache engine) to speed up query results, e.g. static blog posts and menu, but didn't make significant difference..So I would like to discuss how to rea

#speed #caching #cakephp
1 Answers
Kristi
Kristi

137

Category: Routing

Can't get query strings from URL

This my code:<?php public function getUser() {   if ($this->Auth->user()) {     $userId = (empty($this->request->query['id']) ? null : $this->re

SOLVED #query #string #url
1 Answers

Category: Models & ORM

Work with contain hasMany association and to retrieve particular fields only?

I'd like to know how to retrieve particular fields in the associated table when using containable queries? To be more specified, I have the following tables: Posts, Users that a user may have one or m

SOLVED #contain #association #hasmany
1 Answers
Kristi
Kristi

137

Category: Models & ORM

Table::get($name)->hasAny(['key' => 'value'] is not working in cakephp 3

Cake shows error unknown method "hasAny" when checking a record exists or not. Neither this..TableRegistry::get('Posts')->hasAny(['Post.id' => 1]);or that$this->Posts->hasAny(array(['Post.

SOLVED
1 Answers
Kristi
Kristi

137

Category: Security

How to prevent Oauth2 app key and secret hard-coded in CakePHP?

Again Hi,I have a small application that uses Oauth2 to interact with third party service provider. I'd like to know if there is any way to protect key/secret in source code that other people cannot a

SOLVED #cakephp #security
1 Answers

Category: Debugging

How to check latest SQL logs in the controller?

Hi,Is there a way to see latest SQL logs in CakePHP's controllers? I'd like to do this checking in my controller before rendering a view. Like: <?php echo $this->element('sql_dump'); ?

#cakephp #sql
1 Answers