Angular 2 CakePHP integration

We have a website written in php using the CakePHP framework which we want to move away from to angular 2 Is it possible to create an angular 2 page utilizing rest http calls and somehow plug that page seamlessly into our CakePHP website? That way ...
more »

2017-05-23 21:05 (1) Answers

CakePHP 3 app broken after "composer update"

I decided to run "composer update" command another time to get the app back up to date but now it's completely broken as it can't find a certain class anymore. Fatal error: Class 'App\Application' not found in /home/rlvpr/public_html/webroot/index.p...
more »

2017-05-23 15:05 (2) Answers

how to upload image using cakephp3.4

this is the basic code and i have to write the extra codes as per this function public function addmovie() { $tabledata = TableRegistry::get('Movies'); if ($this->request->is('post')) { $moviedata =...
more »

2017-05-23 13:05 (0) Answers

How do I access SESSIONs in CakePHP's app.php?

I am using CakePHP 3.3 I am trying to set session timeout's value and other settings in app.php to a value stored in config database table. I tried using the line below but it's just stoping execution of the webpage. $myConfigs = Cake\View\Helper\...
more »

2017-05-23 12:05 (1) Answers

Multiple References to Associated Table in Cakephp

After associating two tables (many weather radar frames which belong to weather radar sites) with belongsTo and hasMany, I was hoping to generate JSON with two "contains" on the same table (and different conditions) so I can list only the frames whic...
more »

2017-05-22 19:05 (1) Answers

Cakephp and iOS 10.3.2

Since the new iOS update (10.3.2), we can't reach our website from an Apple device. Safari, Chrome or Firefox are returning a blank page or an error page saying there's a network problem. We've tried from different places, different kind of iphones,...
more »

2017-05-22 16:05 (1) Answers

CakePHP Model validation not working properly

I am new to CakePHP and have created a normal form to submit first name. My table name is "registers. I have created a controller named RegistersController (RegistersController.php) and a model named Register (Register.php) . Each time i submit afte...
more »

2017-05-22 08:05 (1) Answers

how to use "where in query" cakephp 3.x

i have use mysql query: SELECT doctor_id FROM `appointments`where doctor_id in (SELECT doctor_id FROM doctor_staffs WHERE staff_id=11) Result: doctor_id 2 4 5 but I need to know how to write it in CakePHP 3 ...
more »

2017-05-22 08:05 (1) Answers

CakePHP update on form change

This form : <?php echo $this->Form->create(); echo $this->Form->select('quantity', [1,2,3,4,5,6,7,8,9], ['value'=> $this->Number->format($cartitem['quantity']) , 'class'=>'form-control', 'type'=>'number'...
more »

2017-05-22 02:05 (1) Answers

How to use CASE statement with CakePhp 3.x?

I want to execute the following select statement in CakePHP 3.X SELECT ... (CASE WHEN declined_by = 1 THEN Customer WHEN declined_by = 2 THEN Admin WHEN declined_by = 3 THEN Both ELSE None END) AS `Declined_by` ... But I doesn't want t...
more »

2017-05-21 08:05 (2) Answers

CakePHP query returns two rows instead of one

I'm trying to translate an SQL query into a CakePHP query. Where the SQL query returns one row, the CakePHP query returns 2 rows with the columns id & cover in the first row & files_with_cover in the second. Naturally I'd like one row with al...
more »

2017-05-21 00:05 (1) Answers

Eclipse PHP formatter for CakePHP

In Eclipse In Window->Preferences->PHP->Code Style->Formatter I want to import for CakePHP instead of PHP but I haven't find in the file in format XML. I appreciate you in advanced. It should be a xml file like this: ...
more »

2017-05-19 20:05 (3) Answers

Updating translations (i18n) in CakePHP 3

I want to translate my app. I followed exactly the CakePHP 3 documentation but I'm missing something in the middle. Context I've my app with all text in English using cake core function __('Dummy text'); and it's works fine. Extracting Then I extra...
more »

2017-05-19 17:05 (0) Answers

test file upload with cakephp

Is it possible to test the file-upload in your own computer with an emulated server, or it's only possible to a real server??? If i try to upload a file, i get the message 'The download could not be saved. Please, try again.'. (The message is coming...
more »

2017-05-19 15:05 (1) Answers

Showing array value as the number in the array

Currently my code shows the year from 1885 to 2017. What this does is show the years like so 0 = 1885, 1 = 1886. What I want is that it shows it like this 1885 = 1885, 1886 = 1886 etc. (This resembles the date a car is built) $options = []; for ($...
more »

2017-05-19 10:05 (3) Answers

Language switch for website in CakePHP

Im trying to make a language switch in my CakePHP website but I cant seem to pass the correct information to my functions. in my website I have two buttons English and Dutch: <?php echo $this->Html->link(__('ENG'), array('controller' =>...
more »

2017-05-19 10:05 (2) Answers