<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7635261402950375307</id><updated>2024-08-30T16:06:19.041-03:00</updated><category term="Integrando Zend Framework com Smarty"/><category term="Smarty"/><category term="Strict Standards"/><category term="Strict Standards: Only variables should be passed by reference"/><category term="Zend Framework"/><title type='text'>Wesley David Santos</title><subtitle type='html'>Blog destinado a analistas, programadores e entusiastas.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7635261402950375307.post-4142760991513631968</id><published>2021-03-31T10:35:00.007-03:00</published><updated>2021-03-31T11:09:29.477-03:00</updated><title type='text'>wkhtmltopdf - Done Exit with code 1 due to network error: ContentNotFoundError</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Vou apresentar uma explicação simples para um erro chato no wkhtmltopdf, que realiza a conversão de HTML para PDF em PHP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;É um programa muito bom.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Alguns dos erros aprensetados podem ser esses: Failed without error message: wkhtmltopdf &quot;h&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Esse erro é apresentado pelo próprio Script do wkhtmltopdf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ao ativar essa Option é apresentado o erro correto do prompt&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$pdf = new Pdf([&#39;commandOptions&#39; =&amp;gt; [&#39;useExec&#39; =&amp;gt; true]]);&lt;/div&gt;&lt;div&gt;$pdf-&amp;gt;addPage(&#39;teste_pdf.html&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Erro após option: &#39;wkhtmltopdf&#39; não é reconhecido como um comando interno ou externo, um programa operável ou um arquivo em lotes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Faça o teste no seu CMD tentando executar somente o comando &quot;wkhtmltopdf&quot;, se apresentar o mesmo erro, adicione o bin dele nas suas Variáveis de Ambiente do SO.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Blz, você já adicionou o comando no Path e ainda está apresentando o erro. Sei isso é muito chato.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Informe a classe Pdf onde está localizado o binário, verifique o exemplo abaixo.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$pdf = new Pdf(&#39;teste_pdf.html&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$binary = &#39;C:/wkhtmltopdf/bin/wkhtmltopdf.exe&#39;; //definindo o caminho do binário&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$pdf-&amp;gt;binary = $binary; //setando o binário&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ok, agora sua classe está encontrando o binário, mas ainda apresenta o erro &quot;Code 1&quot;, apenas continue lendo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;O que eu fiz para consertar é debugar a Classe que gera o PDF, mas especificamente a Classe &quot;Command.php&quot; que fica dentro de &quot;vendor\mikehaertl\php-shellcommand\src&quot; se você estiver usando Composer.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No método &quot;public function execute()&quot; mas especificamente na linha 373 é gerado o comando de execução, eu mandei exibir o comando e executei no CMD, o PDF foi criado certinho que meu olho até brilhou.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;O Problema é que esse erro de code 1 é gerado para qualquer URL que não foi carregada corretamente, então se você tiver uma Fonte/Js/Css o qualquer URL de META que não foi carregado é apresentado esse erro, e como o programa &quot;wkhtmltopdf&quot; trata qualquer erro como erro potencial ele não gera o PDF, então alterei a classe &quot;Command.php&quot;, na linha de validação adicionei o &quot;code 1&quot; como válido ficando assim&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if ($this-&amp;gt;_exitCode !== 0 &amp;amp;&amp;amp; $this-&amp;gt;_exitCode !== 1) {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pode ser essa a forma correta de consertar o erro, talvez não, mas eu fiz isso e fiquei feliz e nível de stress baixou. Se você procura a felicidade essa é uma cura.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Usei a classe que está no GIT https://github.com/mikehaertl/phpwkhtmltopdf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No composer você pode usar a chamada: &quot;mikehaertl/phpwkhtmltopdf&quot;: &quot;*&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Abraço.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/4142760991513631968/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://wdsdeveloper.blogspot.com/2021/03/wkhtmltopdf-done-exit-with-code-1-due.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/4142760991513631968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/4142760991513631968'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/2021/03/wkhtmltopdf-done-exit-with-code-1-due.html' title='wkhtmltopdf - Done Exit with code 1 due to network error: ContentNotFoundError'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7635261402950375307.post-3705944869794801394</id><published>2011-05-29T20:47:00.000-03:00</published><updated>2014-06-10T11:27:45.537-03:00</updated><title type='text'>Mais um Erro Simples de resolver =&gt; failed to open stream: HTTP wrapper does not support writeable connections in</title><content type='html'>Hoje quando estava criando um formulário com upload de imagens tive o seguinte erro &quot;failed to open stream: HTTP wrapper does not support writeable connections in&quot; fiz uma pesquisa rápida no google e verifiquei que muitas pessoas passaram por este problema, então decidir compartilhar como resolvi este problema.&lt;br /&gt;
&lt;br /&gt;
Esse erro é simples de resolver, observe em seu código você deve estar passando o caminho absoluto para o diretório onde a imagem irá ficar e é ai que esta o erro, você deve apenas informar o diretório onde a imagem irá ficar.&lt;br /&gt;
&lt;br /&gt;
Exemplo:&lt;br /&gt;
&lt;br /&gt;
Ao invés de usar&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $caminhoImg = &quot;http://www.site.com.br/upload/img/&quot;;&lt;br /&gt;
Use&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $caminhoImg = &quot;upload/img/&quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Comigo isso resolveu.</content><link rel='replies' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/3705944869794801394/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/05/mais-um-erro-simples-de-resolver-failed.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/3705944869794801394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/3705944869794801394'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/05/mais-um-erro-simples-de-resolver-failed.html' title='Mais um Erro Simples de resolver =&gt; failed to open stream: HTTP wrapper does not support writeable connections in'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7635261402950375307.post-3866169288759244219</id><published>2011-05-11T17:13:00.003-03:00</published><updated>2014-06-10T11:28:04.636-03:00</updated><title type='text'>unexpected T_CLASS - Erro chato mas simples</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Hoje tive um problema chato, não aquele chato de difícil aquele chato de incomodar, sempre desenvolvo os sistemas em uma maquina local e como reutilizo frameworks ou classes prontas para facilitar no desenvolvimento&amp;nbsp;o sistema funciona corretamente em localhost mas quando realizei o upload para o servidor apareceu este erro &quot;unexpected T_CLASS&quot; esse erro se deve ao formato&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Unix do arquivo, sendo assim a solução para este erro é salvar o arquivo em outro formato. Fica ai a dica para aqueles que encontram este problema. Mudem o formato&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Unix&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;do arquivo.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/3866169288759244219/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/05/unexpected-tclass-erro-chato-mas.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/3866169288759244219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/3866169288759244219'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/05/unexpected-tclass-erro-chato-mas.html' title='unexpected T_CLASS - Erro chato mas simples'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7635261402950375307.post-8067772599622892889</id><published>2011-04-21T20:16:00.011-03:00</published><updated>2014-06-10T11:28:15.119-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Integrando Zend Framework com Smarty"/><category scheme="http://www.blogger.com/atom/ns#" term="Smarty"/><category scheme="http://www.blogger.com/atom/ns#" term="Zend Framework"/><title type='text'>Integrando Zend Framework -1.11.4 com Smarty -3.0.6</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Olá, galera, hoje irei apresentar como usar o Smarty com o Zend Framework.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 20px;&quot;&gt;Smarty é uma biblioteca em Php que possibilita separar a interface gráfica da lógica de programação, desta forma o web design&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 20px;&quot;&gt;não irá interferir na lógica de programação e o programador não irá interferir no layout do site, isso gera uma grande facilidade em trabalhos em equipe &amp;nbsp;com isso&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 20px;&quot;&gt;facilita e melhora o desenvolvimento de qualquer aplicação em Php.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Zend Framework é um framework de código aberto totalmente orientado a objeto e seguindo rigorosamente o padrão MVC mantendo assim o código sempre limpo e de fácil manutenção por qualquer um que for dar suporte ao site.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 20px;&quot;&gt;O Zend já possui um ótimo sistema de views que trabalha com a extensão .phtm, então porque usar um outro sistema de templates.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 20px;&quot;&gt;As views .phtml utilizam script php para apresentar as informações com isso o&amp;nbsp;web design&amp;nbsp;terá que ter conhecimentos em php ou o programador php terá que trabalhar com os layouts. Outra grande vantagem que encontro no uso do Smarty é que imagina que haverá uma mudança de framework agora irá utilizar o CakePhp,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;CodeIgniter&amp;nbsp;&amp;nbsp;ou algum outro, se você utilizar Smarty não haverá a necessidade de mudar nenhum tipo de tratamento no layout.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Não vou abordar sobre as vantagens e desvantagens de se utilizar o Smarty com Zend Framework, na internet existem muitos artigos abordando esse tema. Aqui vou apenas apresentar como é simples a integração entre os dois, então vamos ao que interessa.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Neste post utilizei o Zend Tool para criar o projeto, num post posterior ensino como instalar o Zend Tool e usar as suas funcionalidades.&lt;br /&gt;
Link para download do Zend&amp;nbsp;&lt;a href=&quot;http://www.framework.zend.com/download/current/&quot;&gt;http://www.framework.zend.com/download/current/&lt;/a&gt;&lt;br /&gt;
Link para download do Smarty&amp;nbsp;&lt;a href=&quot;http://www.smarty.net/download&quot;&gt;http://www.smarty.net/download&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Neste post eu considero que você já tenha criado o projeto seguindo os padrões da ZF, como o Zend Tool não adiciona a biblioteca automaticamente abra a pasta do ZF que você baixou e copie a pasta Zend ela se encontra dentro da pasta&amp;nbsp;library, agora cole ela dentro da pasta&amp;nbsp;library do seu projeto.&lt;br /&gt;
Agora&amp;nbsp;vá para a pasta do Smarty que você baixou e copie a pasta&amp;nbsp;libs e cole ela dentro da pasta&amp;nbsp;library do seu projeto, agora mude o nome da pasta libs para Smarty.&lt;br /&gt;
&lt;br /&gt;
Com isso você tem as duas bibliotecas já gravadas em seu projeto agora vamos realizar a integração entre as duas.&lt;br /&gt;
&lt;br /&gt;
Abra o&amp;nbsp;application.ini o caminho padrão dele é&amp;nbsp;application\configs\application.ini e adicione a linha&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;autoloadernamespaces[] = &quot;SmartyMain&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Exemplo do&amp;nbsp;application.ini&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruvJ8omFfPMJL0z_VhyhWI_DZjJqyjbOsGXUk9pT4uPzpEe3vB-ST72Ar32UXUT-GYR9TYTJibkS-3iZeayHO9ULHOmxEJVf7o_b1AdvCTInKYXDNyVRt_1k0YCL9uRU8emPYyvWgixE/s1600/application.ini.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruvJ8omFfPMJL0z_VhyhWI_DZjJqyjbOsGXUk9pT4uPzpEe3vB-ST72Ar32UXUT-GYR9TYTJibkS-3iZeayHO9ULHOmxEJVf7o_b1AdvCTInKYXDNyVRt_1k0YCL9uRU8emPYyvWgixE/s1600/application.ini.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Dentro do arquivo&amp;nbsp;Bootstrap.php adicione o método abaixo, ele que indica ao ZF qual tipo template usar&amp;nbsp;e onde ele se encontra:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;protected function _initView() &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// aqui podemos passar quaisquer parâmetros que sejam atributos do objeto smarty &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// se quisermos habilitar o cache, por exemplo: &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$params = array( &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;caching&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; true, &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;cache_lifetime&#39; =&amp;gt; 30 &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * Aqui você define onde encontrar as pastas do templates, templates_c, cache e config&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$view = new SmartyMain(&#39;application/views/&#39;, $params); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * Aqui define como o Zend irá encontrar o template necessário para cada ação do usuário não é indicado alterar&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$viewRenderer-&amp;gt;setView($view) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt;setViewBasePathSpec($view-&amp;gt;getEngine()-&amp;gt;template_dir) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt;setViewScriptPathSpec(&#39;:controller/:action.:suffix&#39;) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt;setViewScriptPathNoControllerSpec(&#39;:action.:suffix&#39;) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt;setViewSuffix(&#39;tpl&#39;); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Agora você terá que criar a Classe&amp;nbsp;SmartyMain.php dentro da pasta&amp;nbsp;library, esta classe é responsável por instânciar a classe Smarty é e nesta classe que você define as pastas onde ficarão os templates.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;require_once(&#39;Smarty/Smarty.class.php&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;class SmartyMain implements Zend_View_Interface&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Smarty object&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @var Smarty&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;protected $_smarty;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Constructor&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $tmplPath&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param array $extraParams&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function __construct($tmplPath = null, $extraParams = array())&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty = new Smarty();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (null !== $tmplPath) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;setScriptPath($tmplPath);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach ($extraParams as $key =&amp;gt; $value) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;$key = $value;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Return the template engine object&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return Smarty&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function getEngine()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $this-&amp;gt;_smarty;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Set the path to the templates&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $path The directory to set as the path.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function setScriptPath($path)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (is_readable($path)) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * Aqui você irá definir quais são os diretorios onde os templates, templates_c , cache e config serão armazenados&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * estes nomes são o padrão do Smarty&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;$this-&amp;gt;_smarty-&amp;gt;template_dir = $path.&quot;templates&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;compile_dir &amp;nbsp;= $path.&quot;templates_c&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;cache_dir &amp;nbsp; &amp;nbsp;= $path.&quot;cache&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;config_dir &amp;nbsp; = $path.&quot;config&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new Exception(&#39;Invalid path provided&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Retrieve the current template directory&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return string&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function getScriptPaths()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return array($this-&amp;gt;_smarty-&amp;gt;template_dir);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Alias for setScriptPath&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $path&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $prefix Unused&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function setBasePath($path, $prefix = &#39;Zend_View&#39;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $this-&amp;gt;setScriptPath($path);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Alias for setScriptPath&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $path&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $prefix Unused&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function addBasePath($path, $prefix = &#39;Zend_View&#39;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $this-&amp;gt;setScriptPath($path);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Assign a variable to the template&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $key The variable name.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param mixed $val The variable value.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function __set($key, $val)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;assign($key, $val);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Allows testing with empty() and isset() to work&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $key&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return boolean&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function __isset($key)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return (null !== $this-&amp;gt;_smarty-&amp;gt;get_template_vars($key));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Allows unset() on object properties to work&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $key&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function __unset($key)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;clear_assign($key);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Assign variables to the template&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Allows setting a specific key to the specified value, OR passing&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * an array of key =&amp;gt; value pairs to set en masse.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @see __set()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string|array $spec The assignment strategy to use (key or&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * array of key =&amp;gt; value pairs)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param mixed $value (Optional) If assigning a named variable,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * use this as the value.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function assign($spec, $value = null)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (is_array($spec)) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;assign($spec);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;assign($spec, $value);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Clear all assigned variables&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Clears all variables assigned to Zend_View either via&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * {@link assign()} or property overloading&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * ({@link __get()}/{@link __set()}).&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return void&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function clearVars()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;_smarty-&amp;gt;clear_all_assign();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * Processes a template and returns the output.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @param string $name The template to process.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * @return string The output.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public function render($name)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $this-&amp;gt;_smarty-&amp;gt;fetch($name);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Agora crie os diretórios onde ficarão os templates, &amp;nbsp;o padrão que esta sendo utilizado é esse:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD8YifANeqFK8ZaY7k8bhA9rSRZBC4RZgQwEs-g4NKgNZxbf3A7KYjqqzsKLTSejajG3b0Mwql1cXGYh41rsDFV7w7BO4M78h3lkSj5BL8qOlOXXr8Cu3OmxOo0egVkGrpcADpEJimJBc/s1600/diretorios_smarty.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD8YifANeqFK8ZaY7k8bhA9rSRZBC4RZgQwEs-g4NKgNZxbf3A7KYjqqzsKLTSejajG3b0Mwql1cXGYh41rsDFV7w7BO4M78h3lkSj5BL8qOlOXXr8Cu3OmxOo0egVkGrpcADpEJimJBc/s1600/diretorios_smarty.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usando o padrão do ZF&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #76a5af;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;Controller/Action&lt;/span&gt;&amp;nbsp;de acesso as views, &amp;nbsp;para cada controller você deverá criar uma pasta e dentro desta pasta o nome do template e ele é de acordo com a ação a ser realizada, exemplo:&lt;br /&gt;
&lt;br /&gt;
Para o &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;IndexController ficara desta forma templates/index/index.tpl&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Para o&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;AlunoController ficara desta forma&amp;nbsp;templates/aluno/index.tpl&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Para o&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;AlunoController ficara desta forma&amp;nbsp;templates/aluno/novo.tpl&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Dependendo da ação a ser executada irá chamar o template necessário.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqmy8pyFyJ46JH3cke7SQIvON5BlZffCuI2Aslg-EFUBQyQ1df7YhbUCOOq9jwxjXPJQ1dKbePI53lHjmCgATCY1dvzcfVtQ9gqI3S_kYdEAtEiCy8umvGZy3shgI-KrlrnOdD0Ubyw0/s1600/diretorios_smarty_2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqmy8pyFyJ46JH3cke7SQIvON5BlZffCuI2Aslg-EFUBQyQ1df7YhbUCOOq9jwxjXPJQ1dKbePI53lHjmCgATCY1dvzcfVtQ9gqI3S_kYdEAtEiCy8umvGZy3shgI-KrlrnOdD0Ubyw0/s1600/diretorios_smarty_2.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;Estrutura completa do projeto:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB3jzvYnbhrTpuvIm3x0jaQKq54i8-86ehAmsm1i6fCfcbId49RQODSbKcvxeE8qwkjIqX5d4JqMizi3yLHb87SetZwP-Sz5r0VIS9pdLbsAntBTjKTF0wrC1AUfTJyTaMgnPFeU38bj0/s1600/diretorios_smarty_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB3jzvYnbhrTpuvIm3x0jaQKq54i8-86ehAmsm1i6fCfcbId49RQODSbKcvxeE8qwkjIqX5d4JqMizi3yLHb87SetZwP-Sz5r0VIS9pdLbsAntBTjKTF0wrC1AUfTJyTaMgnPFeU38bj0/s1600/diretorios_smarty_3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;Que tal agora fazer um teste, adicione o método abaixo dentro da classe&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;IndexController&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;public function indexAction()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// cria algumas variáveis &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$projeto = &quot;Integrando Smarty e Zend Framework&quot;; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$dados_completo = array( &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;array(&#39;nome&#39; =&amp;gt; &#39;Wesley&#39;, &#39;sobrenome&#39; =&amp;gt; &#39;David Santos&#39;),&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;array(&#39;nome&#39; =&amp;gt; &#39;Fulano&#39;, &#39;sobrenome&#39; =&amp;gt; &#39;de tal&#39;) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// inclui as variáveis na view &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;view-&amp;gt;assign(&#39;projeto&#39;, $projeto); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;view-&amp;gt;assign(&#39;dados_completo&#39;, $dados_completo); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Lucida Grande&#39;, Verdana; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;Agora dentro do &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;index.tpl&lt;/span&gt; localizado dentro de &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e06666;&quot;&gt;templates/index/index.tpl&lt;/span&gt; adicione:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;lt;p&amp;gt;{$projeto}&amp;lt;/p&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;lt;table&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{foreach from=$dados_completo item=registro} &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;tr&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;{$registro.nome}&amp;lt;/td&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;{$registro.sobrenome}&amp;lt;/td&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/tr&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{/foreach} &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: inherit;&quot;&gt;&amp;lt;/table&amp;gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Lucida Grande&#39;, Verdana;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;Agora é só abrir o navegador e testar.&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &#39;Lucida Grande&#39;, Verdana; font-size: 13px;&quot;&gt;Espero que tenham gostado, qualquer dúvida estou a disposição.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/8067772599622892889/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/04/integrando-zend-framework-1114-com.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/8067772599622892889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/8067772599622892889'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/04/integrando-zend-framework-1114-com.html' title='Integrando Zend Framework -1.11.4 com Smarty -3.0.6'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruvJ8omFfPMJL0z_VhyhWI_DZjJqyjbOsGXUk9pT4uPzpEe3vB-ST72Ar32UXUT-GYR9TYTJibkS-3iZeayHO9ULHOmxEJVf7o_b1AdvCTInKYXDNyVRt_1k0YCL9uRU8emPYyvWgixE/s72-c/application.ini.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7635261402950375307.post-3003702744954042213</id><published>2011-04-19T22:56:00.000-03:00</published><updated>2014-06-10T11:28:22.720-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Strict Standards: Only variables should be passed by reference"/><title type='text'>COMO RESOLVER Strict Standards: Only variables should be passed by reference</title><content type='html'>Oi, galera.&lt;br /&gt;
&lt;br /&gt;
Venho apresentar a vocês um erro que tem ocorrido muito nas novas versões do Php, &quot; Strict Standards: Only variables should be passed by reference&amp;nbsp;&quot; (&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: georgia, arial, verdana, tahoma, &#39;times new roman&#39;; font-size: 14px; line-height: 21px;&quot;&gt;Erro fatal: Apenas as variáveis ​​podem ser passadas por referência&lt;/span&gt;), este erro informa que você só pode passar variáveis como referência e não uma função que retorna uma matriz.&lt;br /&gt;
&lt;br /&gt;
Eu não conhecia este erro até que ele bateu na minha porta. Então vamos deixar de enrolar e falar como resolver este erro.&lt;br /&gt;
&lt;br /&gt;
Verifique a linha que informa o erro provavelmente você está passando como referência um função que retorna uma matriz, exemplo:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome&lt;/span&gt; = &quot;wesley_david_santos&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome_arr&lt;/span&gt; = end( explode( &#39;_&#39;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome&lt;/span&gt;) );&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
No exemplo acima a variável $nome recebe um texto separado por&amp;nbsp;underline&amp;nbsp;( _ ), na linha seguinte a variável passa pela função explode() onde é transformado em um array que já é passado como referência para a função end() e é nisso que gera o erro, pois não é permitido passar o retorno de um array para outra função, o método que você deve fazer é atribuir este retorno a uma variável e usar esta variável como referência, exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome&lt;/span&gt;&amp;nbsp;= &quot;wesley_david_santos&quot;;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; $arr&lt;/span&gt; =&amp;nbsp;explode( &#39;_&#39;,&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome&lt;/span&gt;) ;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome_arr&lt;/span&gt;&amp;nbsp;= end( &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;arr&lt;/span&gt;&amp;nbsp;);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Neste exemplo estou atribuindo o retorno da função explode() a uma variável com o nome de $arr e estou passando esta variável como referência na função end() desta forma não gera o erro.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Um outro exemplo meio grotesco de fazer isso, não recomendo, estou mostrando para que você possa ver outra forma de contornar o erro.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome&lt;/span&gt;&amp;nbsp;= &quot;wesley_david_santos&quot;;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome_arr&lt;/span&gt;&amp;nbsp;= end(&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$arr&lt;/span&gt;&amp;nbsp;=&amp;nbsp;explode( &#39;_&#39;,&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;$nome&lt;/span&gt;)&amp;nbsp;);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Neste exemplo já atribuo o array a uma variável que já é passada como referência para a outra função.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Esse erro é gerado por uma corrupção na memória, uma vez cheguei a ler rapidamente isso na documentação do Php.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Mesmo se ainda não aconteceu contigo, evite passar o retorno de uma matriz como referência para outra função pois talvez a versão do seu Php ainda não identifica este erro mas um dia você vai atualizar a versão, e ai complicou, abrir os scripts e alterar, então é melhor evitar.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Qualquer dúvida estou as ordens. &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/3003702744954042213/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/04/strict-standards-only-variables-should.html#comment-form' title='55 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/3003702744954042213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/3003702744954042213'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/04/strict-standards-only-variables-should.html' title='COMO RESOLVER Strict Standards: Only variables should be passed by reference'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>55</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7635261402950375307.post-6836268154415634143</id><published>2011-04-19T18:16:00.000-03:00</published><updated>2014-06-10T11:28:32.375-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Strict Standards"/><title type='text'>COMO RESOLVER Erro Strict Standards: Declaration of</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Oi galera.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Esses dias tive um erro chato para resolver quando tive que mudar todo um projeto feito em Php para outro servidor, quando terminei de transferir todos os arquivos para novo servidor lá estava ele :&amp;nbsp;&amp;nbsp;Strict Standards: Declaration of na verdade este não é um erro e sim um warning (aviso), o&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; line-height: 21px;&quot;&gt;&amp;nbsp;Php sugere mudanças ao seu código as quais irão assegurar melhor interoperabilidade e compatibilidade futura do seu código.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Fiz algumas pesquisas na internet e descobrir que é por sobrecarga de método, pois como muitos sabem o Php não aceita sobrecarga de métodos em comparação a Java, C# entre outros.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Para resolver este problema é o seguinte :&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Referêncie a classe de pai de forma correta para que o Php possa identificar que se trata de classes diferentes, use o parent::nomeMetodo() para chamar métodos da classe pai e se mesmo assim o erro continuar é porque o _&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;autoload ou outra forma de include que você utiliza pode ter chamado a subclasse antes da classe pai ser analisado.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Uma outra forma não recomendada de para de exibir estes erros é usar o código:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 13px; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 21px; white-space: normal;&quot;&gt;&lt;strong style=&quot;font-style: normal; font-weight: bold;&quot;&gt;error_reporting(0);&lt;br /&gt;
ini_set(“display_errors”, 0 );&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;com isso o Php não irá exibir nenhum tipo de erro na tela, mas isso não é recomendado pois pode causar falhas de segurança, ou mal funcionamento do seu site.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;Quando você estiver desenvolvendo um projeto sempre adicione o código:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 21px; white-space: normal;&quot;&gt;&lt;strong style=&quot;font-style: normal; font-weight: bold;&quot;&gt;error_reporting(E_ALL);&lt;br /&gt;
ini_set(“display_errors”, 1 );&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; line-height: 21px;&quot;&gt;&lt;strong style=&quot;font-style: normal; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-weight: normal; line-height: normal; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;e o Php irá exibir todos os erros na tela.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 21px; white-space: normal;&quot;&gt;&lt;strong style=&quot;font-style: normal; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: monospace; font-size: 13px; font-weight: normal; line-height: normal; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 21px;&quot;&gt;É isso qualquer dúvida é só entrar em contato.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://wdsdeveloper.blogspot.com/feeds/6836268154415634143/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/04/erro-strict-standards-declaration-of.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/6836268154415634143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7635261402950375307/posts/default/6836268154415634143'/><link rel='alternate' type='text/html' href='http://wdsdeveloper.blogspot.com/2011/04/erro-strict-standards-declaration-of.html' title='COMO RESOLVER Erro Strict Standards: Declaration of'/><author><name>Wesley David Santos</name><uri>http://www.blogger.com/profile/05451228884121444844</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>