Questions tagged [cakephp-2.5]

This tag relates to the 2.5.x branch of the CakePHP MVC framework.

CakePHP 2.5 was released on May 12, 2014.

CakePHP 2.5 is a fully API compatible upgrade from 2.4.

You should add the generic tag in addition to this one.

Useful links:

239 questions
12
votes
3 answers

Generating PDFs with images way too slow

A big bottleneck I have at the moment is PDF generation each time someone places an order. It's not a big deal for a single order, but when there are a lot in a short time frame, this process is very slow. The PDF needs text information, a QR code,…
Dave
  • 27,341
  • 18
  • 106
  • 177
8
votes
3 answers

How to change page title in CakePHP 2.5?

From 2.5 Migration Guide: $title_for_layout is deprecated. Use $this->fetch('title'); and $this->assign('title', 'your-page-title'); instead. They work in Views, but what to do in Controller? Using $this->assign() throws Fatal error.
mrdaliri
  • 6,594
  • 21
  • 67
  • 101
8
votes
4 answers

CakePHP 2.X Cron Jobs Not Working

EDITS FOR 2017 IN BOTTOM SECTION I've read the following doc entries: http://book.cakephp.org/2.0/en/console-and-shells.html http://book.cakephp.org/2.0/en/console-and-shells/cron-jobs.html As well as this question: Creating Cron Jobs in CakePHP…
bowlerae
  • 1,122
  • 1
  • 14
  • 36
5
votes
3 answers

Notice unserialize error in CakePHP via Redis

Update: Per suggestion from the accepted answer below, I tested reading a negative number: $negativeInt = -1; Cache::write('my-test-count', $negativeInt, 'short'); $readVal = Cache::read('my-test-count', 'short'); debug($readVal); exit; The…
Dave
  • 27,341
  • 18
  • 106
  • 177
4
votes
3 answers

CakePHP unable to reach CakeSession from lib

I added a lib called MyLib, inside my App/Lib folder in CakePHP 2.5.5: App::uses('CakeSession', 'Model/Datasource'); class MyLib { public static function myfunction1() { return CakeSession::read('Config.language'); } public…
trante
  • 30,976
  • 45
  • 174
  • 260
4
votes
1 answer

CakePHP: Always use clear() instead of create()?

there's a small, but very important difference, between calling clear() and create() within a loop: let's assume the following code: foreach ($posts as $post) { $this->Post->create(); $this->Post->id = $post['Post']['id']; …
Johannes N.
  • 2,278
  • 2
  • 25
  • 43
3
votes
2 answers

Cakephp send email in different user selected language

I want to sent email on a specific language regarding of the web language. For example when the user register he has the possibility to select a language for example English - en, Italian - it, German - de and french - fr. The website is …
Johnny
  • 175
  • 1
  • 9
3
votes
1 answer

CakePhp i18n translation words order in .po files

Currently in a view I have this: ', '', AppController::getSiteName()); ?> In my .po…
zeflex
  • 1,436
  • 1
  • 13
  • 27
3
votes
2 answers

Save data in a cakephp hasmany and belongsto association at once

I know this question is asked here a many times but I also tried to follow the solutions provided at my best. As I am learning a cakephp some solutions seemed difficult to implement in a code. I am using cakephp 2.5. What I am trying to do is…
Iglance3
  • 105
  • 1
  • 11
3
votes
1 answer

CakePHP Memcached CakePHP2.5.x

I have upgraded to CakePHP 2.5.x series and now trying to implement the new Memcached engine that replaces Memcache; however I am getting the following: _cake_core_ cache was unable to write 'cake_dev_en-us' to Memcached cache in ... Uncaught…
Pirouet
  • 65
  • 5
3
votes
2 answers

CakePhp: Issue with model and table name

I have StatsController.php with class StatsController extends AppController { public function edit($id = null) { var_dump($this->Stat); } } I have StatModel.php with class Stat extends AppModel { public $useTable = 'tips'; …
zeflex
  • 1,436
  • 1
  • 13
  • 27
2
votes
1 answer

How to fix mocking auth error in cakephp 2 and phpunit4 up?

I'm getting Static method "user" cannot be invoked on mock object even did not mock auth->user. Im using php7, cakephp2.x and phpunit4+ According to cakephp2 documentation : https://book.cakephp.org/2.0/en/development/testing.html If you are using…
monn
  • 23
  • 4
2
votes
1 answer

Constant CAKE_CORE_INCLUDE_PATH already defined CakePHP

I am a beginner to CakePHP, I just got a code of the project to make some minor changes into the project, but as I copy and paste the project files into my wamp server and changed my database constants according to my localhost, I got error and…
Umair Mehmood
  • 484
  • 8
  • 19
2
votes
0 answers

CakePHP controller testing: Mocking models and test method

I am a beginner in unit testing in CakePHP. My version of CakePHP is 2.5.2 and I am using cake test suite 2.5.2. I want to do controller testing. I have tried all methods given in cookbook. I think this is too much complex code for given example in…
2
votes
1 answer

cakephp userid and associated models

I need to match an associated model on a user id, I thought the below code would work since I do get the user_id back for ArticleUser, but it's not giving me the FavoriteArticle I need. The data comes back as null for the FavoriteArticle model, and…
shonatodc
  • 21
  • 3
1
2 3
15 16