Take the 2-minute tour ×

I'm trying out CakePHP now and I can't get my app working because CakePHP "thinks" my model name is 'Tach' when it's in fact 'Tache'.

Why so ?

My controller is defined as : app/controllers/taches_controller.php

class TachesController extends AppController {

function index() {

    $allTaches = $this->Tache->find('all');

    $this->set('taches', $allTaches);



And here's my model : app/models/tache.php

class Tache extends AppModel {

var $useTable = 'taches';


I get an error if I use 'Tache' in my controller :


But if I use 'Tach', I get no error :

        $allTaches = $this->Tach->find('all');

Why can't I use the model name 'Tache' ? Am I doing something wrong ? By the way I'm on php 5.3 and my CakePHP version is 1.3.8

Thanks !


share|improve this question
What version of CakePHP are you using? –  Robert Groves Mar 27 '11 at 22:58
Oh sorry, I forgot. It's 1.3.8. –  Alex Mar 27 '11 at 22:59
It looks like your Taches fell victim of some kind of automatic depluralization. Though I don't know CakePHP.. –  Imi Borbas Mar 27 '11 at 23:01
add comment

1 Answer

up vote 9 down vote accepted

CakePHP's default inflection rules think that Taches is the plural form of Tach.

You'll need to use the Inflector class to add a custom inflection.

See the following:

To recap you'll need to add something like the following to your app/config/bootstrap.php file:

Inflector::rules('plural', array('irregular' => array('tache' => 'taches')));
share|improve this answer
Wow, thanks so much Robert ! –  Alex Mar 27 '11 at 23:07
add comment

Your Answer


