Question

How to Turn off pluralization altogether in cakephp2.2

This is the source code of my page:

<form action="/scores/exam2014s/aview" id="exam2014AviewForm" method="post" accept-charset="utf-8">

In the above code suffix - 's' in 'exam2014s' is appearing automatically, which i dont want kindly help how to avoide the pluralization of the above.

In the bootstrap.php, I have used the following code enter code hereto turnoff pluralization:

Inflector::rules(
'plural', 
array(
    'rules' => array('/^([a-zA-Z_-]*)$/i' => '\1'), 
    'irregular' => array(), 
    'uninflected' => array()
)

);

With the above code in bootstrap I could not fix the problem.

Code in my index.ctp is below:

echo $this->Form->create('exam2014', array('action' => 'aview'));
echo $this->Form->label('Page.name','Name: ',null);
echo $this->Form->input('qr_code');
echo $this->Form->submit();
echo $this->Form->end();

Thanks in advance.

Sai Krishna

Was it helpful?

Solution

why not simply the following code?

echo $this->Form->create(
    'exam2014', 
    array(
       'url' => array('controller' => 'exam2014', 'action' => 'aview')
   )
)

OTHER TIPS

Since Cake2.x the form posts to itself by default. So simply do:

echo $this->Form->create('Exam2014');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top