snipt

Ctrl+h for KB shortcuts

PHP

Corrige erros com nomes em português no cakephp bake

1
2
3
4
5
<?php
//Adicione as linhas abaixo no app/config/bootstrap.php
Inflector::rules('singular', array('rules' => array('/^([a-zA-Z_-]*)oes$/i' => '\1ao')));
Inflector::rules('plural', array('rules' => array('/^([a-zA-Z_-]*)ao$/i' => '\1oes')));
?>
https://snipt.net/embed/d50fdfd62bf1b7945ff3da2e10f1e585/
/raw/d50fdfd62bf1b7945ff3da2e10f1e585/
d50fdfd62bf1b7945ff3da2e10f1e585
php
PHP
5
2019-06-27T06:00:26
True
False
False
/api/public/snipt/28238/
corrige-erros-com-nomes-em-portugues-no-cakephp-bake
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">//Adicione as linhas abaixo no app/config/bootstrap.php</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">Inflector</span><span class="o">::</span><span class="na">rules</span><span class="p">(</span><span class="s1">&#39;singular&#39;</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;rules&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;/^([a-zA-Z_-]*)oes$/i&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;\1ao&#39;</span><span class="p">)));</span> </span><span id="L-4"><a name="L-4"></a><span class="nx">Inflector</span><span class="o">::</span><span class="na">rules</span><span class="p">(</span><span class="s1">&#39;plural&#39;</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;rules&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;/^([a-zA-Z_-]*)ao$/i&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;\1oes&#39;</span><span class="p">)));</span> </span><span id="L-5"><a name="L-5"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
cakephp, php