Re: Carregar endereço a partir do CEP no CakePHP 3 usando AJAX

2016-04-02 Thread Nilson Pena
O correio disponibiliza algum webservice gratuito?

Em sábado, 2 de abril de 2016, Paulo Terra  escreveu:

> Estou tentando carregar o endereço a partir do CEP informado pelo usuário.
> Apesar de encontrar várias pessoas perguntando por isso não encontro uma
> resposta que funcione. Alguém já fez isso no CakePHP 3?
>
> --
> Sign up for our Newsletter for updates.
> http://cakephp.org/newsletter/signup
>
> We will soon be closing this Google Group. But don't worry, we have
> something better coming. Stay tuned for an updated from the CakePHP Team
> soon.
>
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Follow us on Twitter http://twitter.com/CakePHP
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Force Browser Caching image in Cake 3.x

2016-02-20 Thread Nilson Pena
How can I force a browser caching in Cake 3.2?

I have an avatar image in my navbar (menu) that is served by a cake
response action:

public function showAvatar($funcionario_id) {
$this->response->file(ROOT .
"/files/funcionarios/avatars/$funcionario_id . '.jpg'");

$this->response->cache('-1 minute', '+5 days');

return $this->response;
}

But in firebug, I see that this image is not cached in browser.

Am I doing something wrong?

Thanks You in advance

Nilson

-- 
We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problem Console on cakephp 2.7.5

2015-11-02 Thread Nilson Pena
There is something wrong with cakephp 2.7.5. when using the console, for
example:
cakephp/lib/Cake/Console/cake AclExtras.AclExtras aco_sync

I get the following error:

PHP Parse error:  syntax error, unexpected T_STATIC, expecting T_STRING or
T_VARIABLE or '$' in
/home/myDomain/public_html/cakephp/lib/Cake/Core/App.php on line 221

If I switch to version 2.6.11 everything works well!!!

Any idea?

Thank You,

Nilson

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 2.5.5 and 2.6.0-beta released

2014-10-08 Thread Nilson Pena
YES. Cakephp 2.x rocks

Em quarta-feira, 8 de outubro de 2014, mark_story 
escreveu:

> 2.6.x is all that is planned for now. With that said, the door is not
> closed on a 2.7 if the community really wants it. If there is interest, I
> am happy to continue merging new backwards compatible features into 2.x to
> form a 2.7 release.
>
> -mark
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com .
> To post to this group, send email to cake-php@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Prof. Dr. *Nilson Pena*
Av. ACM, 585, sl. 1205
Salvador - Bahia
71 - 3012-3031

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Instance of AppModel inside a Component

2014-08-19 Thread Nilson Pena
Thank you Stephen,

Following your suggestion I did:
$model = ClassRegistry::init($this->Controller->modelClass);

Works like a charm.

Thanks

Prof. Dr. *Nilson Pena*
Av. ACM, 585, sl. 1205
Salvador - Bahia
71 - 3012-3031


On Tue, Aug 19, 2014 at 12:29 PM, Stephen S  wrote:

> You could load any model into your component and automatically gain access
> to AppModel methods.
>
> $model = ClassRegistry::init('AnyModel'); (or $this->Model =
> ClassRegistry::init('AnyModel'))
> $model->appModelMethod();
>
>
> On 19 August 2014 16:13, Nilson Pena  wrote:
>
>> Hi, folks!
>>
>> Do you know how can I get an AppModel instance inside a Component?
>> I need to access a specific method that is inside AppModel.
>>
>> I'm using CakePHP 2.5.3
>>
>> Thank you in advance!
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Kind Regards
>  Stephen Speakman
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Instance of AppModel inside a Component

2014-08-19 Thread Nilson Pena
Hi, folks!

Do you know how can I get an AppModel instance inside a Component?
I need to access a specific method that is inside AppModel.

I'm using CakePHP 2.5.3

Thank you in advance!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Vote for CakePHP on DevDocs!

2014-07-24 Thread Nilson Pena
Voted

Prof. Dr. *Nilson Pena*
Av. ACM, 585, sl. 1205
Salvador - Bahia
71 - 3012-3031


On Thu, Jul 24, 2014 at 9:37 AM, Harold Putman 
wrote:

> DevDocs is really cool, especially since you can set it up to run offline.
>
> In addition to voting someone could write a "Scraper" in Ruby and
> contribute it to the project in GitHub at
> https://github.com/Thibaut/devdocs.
>
>
> On Wednesday, July 23, 2014 9:40:52 PM UTC-4, OJ Tibi - @ojtibi wrote:
>>
>> Hi folks!
>>
>> I've recently stumbled upon an all-in-one documentation web app named
>> DevDocs. I suggest you look around, play with it and search through
>> documentation you might use everyday (vanilla PHP, Angular, vanilla
>> JavaScript, other preprocessors, etc.)
>>
>> If you like DevDocs and love CakePHP, please vote on the card named
>> CakePHP on the "To Do [Others]" list for its inclusion here:
>>
>> https://trello.com/b/6BmTulfx/devdocs-documentation
>>
>> Also, I think it would be helpful to add some comments if you want the
>> authors to know which version of the docs you want to be included.
>>
>> Cheers!
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Rendering PDF from POST basead searches

2014-01-28 Thread Nilson Pena
Thank you.

Nilson


Prof. Dr. *Nilson Pena*
Av. ACM, 585, sl. 1205
Salvador - Bahia
71 - 3012-3031


On Tue, Jan 28, 2014 at 9:37 AM, euromark  wrote:

> I gave you an answer as comment.
>
>
> Am Montag, 27. Januar 2014 16:04:40 UTC+1 schrieb Nilson Pena:
>
>> Hi folks,
>> I use mPDF and the solution proposed in this excellent post [1].
>> Everything works well if the action uses GET. Example:
>> /controller/action/2.pdf wil use the view.ctp inside the pdf folder and
>> render the 2.pdf file.
>>
>> But there are cases that I have to use a form to POST some parameters to
>> do a especific search and return this data to the view. In this case, the
>> /controller/action/2.pdf won't work, once the action only allows POST.
>>
>> How can I workaround this "issue" and keep using this approach on serving
>> PDF?
>>
>> Thank You!
>>
>> Nilson
>>
>> [1] http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2/
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Rendering PDF from POST basead searches

2014-01-27 Thread Nilson Pena
Hi folks,
I use mPDF and the solution proposed in this excellent post [1]. Everything
works well if the action uses GET. Example: /controller/action/2.pdf wil
use the view.ctp inside the pdf folder and render the 2.pdf file.

But there are cases that I have to use a form to POST some parameters to do
a especific search and return this data to the view. In this case, the
/controller/action/2.pdf won't work, once the action only allows POST.

How can I workaround this "issue" and keep using this approach on serving
PDF?

Thank You!

Nilson

[1] http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2/

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CakePHP 3.0.0 dev preview 1 released

2014-01-06 Thread Nilson Pena
Thanks for answer,  Mark!

Cake 3, here we go.

Pray for us :)

Nilson


On Mon, Jan 6, 2014 at 5:44 PM, mark_story  wrote:

> Thanks for asking those questions they are good ones.
>
> > What are the strategic goals of Cake v3?
>
> Hopefully I can give some more background information and the prespective
> of a project maintainer.
>
> > Grow adoption of the framework be switching to "more modern" features?
>
> I can say with some certainty that not supporting PSR-0, composer and
> other community standards has made CakePHP seem 'outdated' in more than a
> few people's eyes.
>
> > Do you feel more developers will give it a chance because it supports
> features like traits, closures and an object-oriented ORM?
>
> I see traits and closures as a means to an end. They should not be a
> reason to choose a framework, but for some people they are. As a library
> developer, they offer some useful ways to allow developers to hook their
> logic in and make some ideas easier and more succinct to express.
>
> > What are the benefits (not features) to devs in v3?
>
> The new ORM is a big benefit. It is also a big downside. In order to use
> Cake3 you need to upgrade, and the upgrade is not a simple one. I totally
> understand that it is not an easy upgrade and it will break a ton of user
> land code. However, what are the alternatives? We intentionally left the
> Model layer alone when developing 2.x as we knew it was a huge undertaking.
> 3 years later, here we are and it is still a huge undertaking. If we stick
> with the current Model layer for another 3 years I think CakePHP will be
> too far behind in mindshare to recover really.
>
> I think there are other benefits like making it simple to use the huge set
> of libraries published on packagist.org. By building the framework around
> these tools we make it very clear for new and existing developers how
> things should be done.
>
> > Reading this latest announcement, it seems like v3 just makes changes
> for changes sake.
>
> I'm sorry you feel that way, but I never change things just to change
> them. Each change I make to CakePHP is strategic. My goals are generally to
> provide an easier to understand, simpler to use, more efficient and faster
> tool for people to build web applications with. Keep in mind that I also
> use CakePHP, and have applications I'll need to be upgrading as well.
>
> > All open-source plugins will need heavy re-writes (unlike v1.x -> v2).
>
> You are right to some degree. I think it depends on the plugin. I had
> plugins that needed to be totally re-written for 2.x.
>
> > Those facts totally negate the "features" of v3 for me and is pretty
> demoralizing. I might as well start also considering other frameworks if
> I'm being forced to scrap all my current plugin code.  If the slate is
> clean there is no reason for me *not* to consider other frameworks. Cake
> may still end up being the best option, but with previous version changes I
> didn't even bother considering the other options because of the relatively
> easy migration.
>
> It is always good to remember once 3.0 is release 2.x won't stop working.
> I plan on continuing to do bug fixes and security updates on 2.x as long as
> people continue to report issues. All the code you've invested in won't
> stop working when we release 3.0.
>
> -Mark
>
>
> On Sunday, 5 January 2014 19:44:07 UTC-5, bbf wrote:
>>
>> This is the first time I've read about the reasoning behind the major
>> changes to 3.0. (for background I've been coding PHP since 1999, using Cake
>> since 2008, and "cakephp" is the only tag I follow on Stackoverflow ;) )
>>
>> What are the strategic goals of Cake v3?
>> Grow adoption of the framework be switching to "more modern" features? Do
>> you feel more developers will give it a chance because it supports features
>> like traits, closures and an object-oriented ORM?  I'm trying to understand
>> why all the breaking changes are being introduced.
>>
>>
>> What are the benefits (not features) to devs in v3?
>> 1) Make it faster to develop apps?
>> 2) Make it easier to develop apps?
>> 3) Make it faster to get started for new-to-Cake devs?
>> 4) Increase features for current Cake devs?
>> 5) ?
>>
>> Maybe I'm dense or not understanding the ramifications of the new
>> features. Reading this latest announcement, it seems like v3 just makes
>> changes for changes sake.  You guys all love coding and it's fun to work on
>> the latest cool features of PHP -- I get that.  You're adding lots of
>> "features" that take advantage of new stuff. But how much of it translates
>> into actual *net benefits* for current developers?
>>
>> Will an OO ORM make Cake easier to code? Faster to code? Faster to
>> interpret/execute? Do things that were impossible before with the non-OO
>> ORM?
>>
>> You mention stuff like "It's new architecture based on PHP 5.4
>> capabilities will offer an easier and more powerful set of tools to build
>> web applications in no time."  How do namespaces, traits, 

Re: CakePHP 3.0.0 dev preview 1 released

2014-01-06 Thread Nilson Pena
I agree with you!!!

Em domingo, 5 de janeiro de 2014, bbf escreveu:

> This is the first time I've read about the reasoning behind the major
> changes to 3.0. (for background I've been coding PHP since 1999, using Cake
> since 2008, and "cakephp" is the only tag I follow on Stackoverflow ;) )
>
> What are the strategic goals of Cake v3?
> Grow adoption of the framework be switching to "more modern" features? Do
> you feel more developers will give it a chance because it supports features
> like traits, closures and an object-oriented ORM?  I'm trying to understand
> why all the breaking changes are being introduced.
>
>
> What are the benefits (not features) to devs in v3?
> 1) Make it faster to develop apps?
> 2) Make it easier to develop apps?
> 3) Make it faster to get started for new-to-Cake devs?
> 4) Increase features for current Cake devs?
> 5) ?
>
> Maybe I'm dense or not understanding the ramifications of the new
> features. Reading this latest announcement, it seems like v3 just makes
> changes for changes sake.  You guys all love coding and it's fun to work on
> the latest cool features of PHP -- I get that.  You're adding lots of
> "features" that take advantage of new stuff. But how much of it translates
> into actual *net benefits* for current developers?
>
> Will an OO ORM make Cake easier to code? Faster to code? Faster to
> interpret/execute? Do things that were impossible before with the non-OO
> ORM?
>
> You mention stuff like "It's new architecture based on PHP 5.4
> capabilities will offer an easier and more powerful set of tools to build
> web applications in no time."  How do namespaces, traits, and closure
> bindings help a dev "build web applications in no time"?
>
> I've been using Cake since 2008. Cake v3 feels to me like I have to
> re-learn Cake from scratch due to the *huge* amount of breaking changes. It
> feels like v3 is a whole new framework.
>
> All my current apps can't be upgraded. All the custom generic
> components/behaviors/plugins I've written over the years which I use for
> *all* my current/future projects will need to be re-written.  All
> open-source plugins will need heavy re-writes (unlike v1.x -> v2).
>
> Those facts totally negate the "features" of v3 for me and is pretty
> demoralizing. I might as well start also considering other frameworks if
> I'm being forced to scrap all my current plugin code.  If the slate is
> clean there is no reason for me *not* to consider other frameworks. Cake
> may still end up being the best option, but with previous version changes I
> didn't even bother considering the other options because of the relatively
> easy migration.
>
>
>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com  'cake-php%2bunsubscr...@googlegroups.com');>.
> To post to this group, send email to 
> cake-php@googlegroups.com 'cake-php@googlegroups.com');>
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>


-- 
Prof. Dr. *Nilson Pena*
Av. ACM, 585, sl. 1205
Salvador - Bahia
71 - 3012-3031

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: how to create search function.

2012-06-06 Thread Nilson Pena
Chetan,

This is a awesome cake blog, congratulations.

Nilson



On Wed, Jun 6, 2012 at 4:08 AM, Chetan Patel wrote:

> Hello Madhuri,
>
> Please check My blog:
>
>
> http://chetan4cake.blogspot.in/2012/06/search-plugin-demo-in-cakephp-20.html
>
> Thanks
> Chetan
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php