Questions tagged [cakephp-3.2]

Questions about the 3.2.x branch of the CakePHP MVC framework. Use this tag in combination with the general [cakephp] tag. If your question applies to CakePHP more generally, use only the [cakephp] tag.

CakePHP 3.2

CakePHP is a PHP development framework using Associative Data Mapping, Front Controller and MVC design patterns.

Version 3.2.0 was released in January 2016.

Resources

145 questions
0
votes
1 answer

CakePHP 3 : returns true even if data is not fetched from database

I'm working in CakePHP 3.2. There is a table user_addresses from which I'm trying to fetch all records of an user public function myFun() { $this->loadModel('UserAddresses'); $user_id = $this->Auth->user('id'); $userAddresses =…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
2 answers

CakePHP 3 : show associated data along with find('all')

I'm working on CakePHP 3.2. I have two tables categories and subcategories where subcategories is associated with categories with foreign key category_id. I have to build a drop down navigation using these two tables. So that It will look like…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

CakePHP 3 : date comparison in view

I'm working on CakePHP 3.2. I want to compare date from timestamp in database with isThisMonth() function of CakePHP. I am listing products whose created date is within 1 month. It will show NEW badge with product. This is what I have done in…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

CakePHP 3 : delete and update array from cookie

I'm using CakePHP 3.2 for writing a shopping cart application. I'm using cookie to add items to the cart. Now I want to update and delete value from cart. so that if user clicks on the same product add to cart with a different quantity value the…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
2 answers

CakePHP 3 : creating multidimensional cookie

I'm working in CakePHP 3.2 and building a shopping cart. I'm using Cookie component to store the products in the cart. This is what I'm doing to add products to the cart public function addToCart() { $this->loadModel('Products'); if…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

Paginate and Sort bug(s)?

In my controller I have my pagination set to order by 2 fields. public $paginate = [ 'limit' => 50, 'order' => ['first_name', 'last_name'] ]; $contacts = $this->paginate($this->Contacts); This works fine on the first page, but since I left out…
Naidim
  • 6,918
  • 2
  • 23
  • 20
0
votes
1 answer

CakePHP 3 : restrict access to whole controller without login

I have a controller UserAddresses where only logged in users are allowed to add/edit/delete their addresses. But since AppController.php contains public function beforeFilter(Event $event) { $this->Auth->allow(['index', 'view', 'display',…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
3 answers

CakePHP 3 : select data from multiple table

I have two tables services and service_requests. service_requests table has foreign key service_id referencing services table. I have to select data from services and service_requests where services.id = service_requests.service_id ORDER BY…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

An exception of BufferNotEmpty from PHPZip

I got this exception, but there's no other useful details. I'm using mpdf6.1.0, and PHPZip2.0.8 . My code s like below. $zip = new Zip(); $mpdf = null; foreach ($htmlArr as $name=>$html) { if ($mpdf === null) { $mpdf = initializePdf(); …
Frank
  • 67
  • 1
  • 1
  • 10
0
votes
1 answer

CakePHP 3.2 slow loading of css files

In CakePHP 3.2 I am having some problems with a slow loading of internal css files after clicking F5 (refreshing the page). The page is often overarranging elements according to the internal css file in an ugly visible to a user way. The problem…
Annabelle
  • 734
  • 9
  • 23
0
votes
2 answers

CakePHP 3 : Trying to get property of non-object

I'm working on CakePHP 3.2 and in login() action, want to allow login to only those whose status is verified = 1 public function login() { if ($this->request->is('post') || $this->request->query('provider')) { $user =…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

Retrieve multiple data Cakephp 3

i got 2 tables (users and technologies) and i need to retrieve data from them both separately inside a 3rd Controller. i can do that using loadmodel and find() then set datas to view via $this->set() but by doing that the website becomes very slow…
0
votes
1 answer

CakePHP3: Generate DB-Query

I'm new to CakePHP and I would like to query locations in my DB depending on Google Maps Lat & Lng. How can I add the two andWhere statements only, if $params['bounds'] is true? $params = [ 'bounds' => 1, 'swLat' => ..., 'swLng' => ..., …
canned
  • 11
  • 1
0
votes
1 answer

How to send variable value from controller to another different view in cakephp3?

I have two controller and two view in my cakephp3. My 1st controllers and views are: 1.importController.php , index.ctp; And my 2nd controllers and views are: 2.titlesController.php , success.ctp; Now I want to send variable value (such as…
0
votes
1 answer

Do not know how to retrieve information with RightJoin on CakePHP 3.2

CakePHP Version: 3.2 Platform and Target: Wamp, MySQq, Google Chrome What I did Right Join between two tables in one controller. I'm trying to retrieve the information and I can't $query = $this->Schedules->find('all') ->rightJoin(['Sessions'=>…
teph
  • 23
  • 4