Re: CakePHP 2.0.0-RC1 Hot and fresh

2011-09-05 Thread Taffarel de Lima
Yeah, finally! I can't wait for the stable version.

2011/9/5 Vitor Pacheco 

> Thanks so much!!
>
> Em Seg 05 Set 2011 11:11:07 BRT, Salines escreveu:
>
>  Thanks!
>>
>> --
>> 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+unsubscribe@**googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/**group/cake-php<http://groups.google.com/group/cake-php>
>>
>
> --
> *Vitor Pacheco*
> Skype: vitor.pacheco.costa
> Msn: vitor-...@hotmail.com
> Cel.: 71 8626-7909
> Tel.: 71 3378-5778 / 71 3287-3475
>
>
> --
> 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+unsubscribe@**googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/**group/cake-php<http://groups.google.com/group/cake-php>
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

-- 
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


Re: $this->Ajax->Form Question to avoid double submit

2011-05-03 Thread Taffarel de Lima
dude try to use this plugin of jquery instead the Ajax helper.
http://jquery.malsup.com/form/

2011/5/3 heohni 

> Another update:
>
> I added a class name to the form
> 
>
> And changed the jquery to
> $('.cForm').submit(function() {
>
> But there is still no difference :-(
> Still 2 submits.
>
> --
> 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
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

-- 
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


Re: read(null,$id) or findById($id) and limit data in associated model

2011-04-26 Thread Taffarel de Lima
I don't understood cleary what you need, but try this

$brand - $this->Brand->Product->find( 'all', array ( 'conditions' => array(
'Product.brand_id' => $some_id )));

I hope this help you!


2011/4/26 Salines 

> UPDATE:
>
> class BrandsController extends AppController {
>
>var $name = 'Brands';
>function view($id = null) {
>if (!$id) {
>$this->Session->setFlash(__('Invalid brand', true));
>$this->redirect(array('action' => 'index'));
>}
>// Need here some conditions, please help..
>$brand = $this->Brand->findById($id);
>$this->set('brand',$brand );
> }
>
> }
>
> --
> 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
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

-- 
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


Re: Error NewBe

2011-01-31 Thread Taffarel de Lima
try some like this


$someone = $this->User->find('first',
array('conditions'=>array('User.username'=>$this->data['User']['username']));


should return an array.

2011/1/31 Joshua Muheim 

> You should check first whether your $someone array has a key "User"
> before trying to access it:
>
> http://php.net/manual/en/function.isset.php
>
> This is a PHP issue, not a CakePHP one. :-)
>
> On Mon, Jan 31, 2011 at 9:07 AM, sadeepap 
> wrote:
> > Hi ,
> >
> > I am a new comer to Cake and has the following error message in one of
> > my codes.
> >
> > Notice (8): Undefined index: User [APP\controllers
> > \users_controller.php, line 28]
> >
> > Code at users_controller.php
> >
> >  > class UsersController extends AppController
> > {
> >var $name='Users';
> >var $uses = array('User');
> >
> >function index(){
> >
> >}
> >
> >function register(){
> >
> >
> >}
> >
> >function uploadcv(){
> >
> >
> >}
> >
> >function login(){
> >
> >$this->set('error',false);
> >
> >if(!empty($this->data))
> >{
> >// $someone=$this->User->findByUsername('alpha');
> >
>  $someone=$this->User->findByUsername($this->data['User']
> > ['username']);
> > if(!empty($someone['User']['password']) &&
> $someone['User']
> > ['password'] == $this->data['User']['password'])
> > {
> >$this->Session->write('User',
> $someone['User']);
> >$this->redirect('/clients');
> > }
> > else
> > {
> >$this->set('error', true);
> > }
> >
> >
> >
> >
> >}
> >}
> >
> >function logout(){
> >
> >
> >}
> > }
> > ?>
> >
> > Can someone please help me ?
> >
> > --
> > 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.comFor
> >  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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

-- 
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


Re: To use App Controller or not to use

2011-01-04 Thread Taffarel de Lima
I think you should learn more about OOP.

2011/1/4 Joshua Muheim 

> I don't know if that's your question, but yes you need to create a
> files app/controllers/app_controller.php; you should NEVER change
> anything in the cake directory, so leave the
> cake/libs/controller/app_controller.php file alone.
>
> CakePHP will find your own app_controller.php file and load it instead
> of the one in the cake/libs/controller folder.
>
> On Fri, Dec 24, 2010 at 4:51 PM, John Maxim  wrote:
> > Thanks Stephen, I may get to test that later in my App.
> >
> > On Dec 24, 7:01 pm, Stephen  wrote:
> >> The AppController is related to every controller you create, this means
> >> every controller will inherit the functions and settings from the
> >> AppController.
> >>
> >> Anything you do in the app_controller or the app_model will be executed
> in
> >> the controllers and models which extend it, unless you override a
> function,
> >> in which you will need to use parent::functionName(); to include the
> >> app_controller's
> >>
> >> On 24 December 2010 07:37, John Maxim  wrote:
> >>
> >>
> >>
> >> > I found the file it's in *\cake\libs\controller
> >>
> >> > On Dec 24, 3:04 pm, John Maxim  wrote:
> >> > > I'm reading this section now:
> >>
> >> > >http://book.cakephp.org/view/957/The-App-Controller
> >>
> >> > > I find that the usefulness of AppController is by creating the
> >> > > components, uses, and helpers in a new folder different path other
> >> > > than in the controller file. But that page says creating the
> >> > > AppController: is defined in /app/app_controller.php
> >>
> >> > > Is it a new file I need to create?
> >>
> >> > > Or is it something else because a comment from that page says the
> file
> >> > > (app_controller.php) is here:
> >>
> >> > > app\cake\libs\controller
> >>
> >> > > The path above doesn't even exist.
> >>
> >> > > The only eg. is:
> >>
> >> > >  >> > > class AppController extends Controller {
> >> > > }
> >> > > ?>
> >>
> >> > > So do I include the Auth component in there (AppController) rather
> >> > > than in the controller file ?
> >>
> >> > > Now even the beforefilter function is entered in AppController which
> >> > > both I haven't seen in any examples.
> >>
> >> > > Are there more examples to this ? Is this normally useful ?
> >>
> >> > > Thanks.
> >>
> >> > > John M.
> >>
> >> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> >> > with their CakePHP related questions.
> >>
> >> > You received this message because you are subscribed to the Google
> Groups
> >> > "CakePHP" group.
> >> > To post to this group, send email to cake-php@googlegroups.com
> >> > 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?hl=en
> >>
> >> --
> >> Kind Regards
> >>  Stephen @ NinjaCoderMonkey
> >>
> >>  www.ninjacodermonkey.co.uk
> >
> > Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
> >
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: Can we mix plain php,html and cakephp?

2010-12-28 Thread Taffarel de Lima
dave, i knew that. the question is there some problems if i want to use cake
mix with php and html?

2010/12/28 Dave Maharaj 

>  Cake can automatically add your selects so you do not need to manually do
> that.
>
>
>
> In controller:
>
>
>
> $departments = $this->Employee->Department->find(‘list’);//get list of all
> the departments
>
> $this->set(compact(‘departments’));
>
>
>
> Then in the form echo $this->Form->input('departments');
>
>
>
> Read the book or API classes as there are options to set empty value =>
> Find in the List, ‘type’,  $options. Whole slew of options available in
> FormHelper
>
>
>
>
>
> *From:* Taffarel de Lima [mailto:taffare...@gmail.com]
> *Sent:* Tuesday, December 28, 2010 4:18 PM
> *To:* cake-php@googlegroups.com
> *Subject:* Re: Can we mix plain php,html and cakephp?
>
>
>
> i don't see anything wrong with that. if there some wrong, someone can
> explain
>
> 2010/12/28 poor-grammar 
>
> hello, i am new to cakephp, and still going thru the manual...
>
> Is there a way to mix cakephp with plain php and HTML i mean
> something like this in the code
>
>
> 
>  echo $this->Form->create('Employee',array('action'=>'edit'));
>echo $this->Form->input('id',array('type'=>'hidden'));
>echo $this->Form->input('emp_name');
>echo $this->Form->input('emp_email');
>echo $this->Form->input('emp_phone');
>echo $this->Form->input('emp_address');
>echo $this->Form->input('emp_joindate');
>   echo $this->Form->input('emp_dob');
>  ?>
> 
> find in the list
> finance
> marketing
> reserve
> deployment
> testing
> research
> 
> Form->end('Save');?>
>
> something like this... there must be a way to mix these 2 . after
> all its the POWER of PHP
>
> also can u please guide me to some links to read what can be done and
> what can't be done while mixing cakephp and php and html...
>
> thanks
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
>
>
>
> --
> *Taffarel de Lima Oliveira (Taffarelo3)*
>
>
>
> *Desenvolvedor Web*
>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: Can we mix plain php,html and cakephp?

2010-12-28 Thread Taffarel de Lima
i don't see anything wrong with that. if there some wrong, someone can
explain

2010/12/28 poor-grammar 

> hello, i am new to cakephp, and still going thru the manual...
>
> Is there a way to mix cakephp with plain php and HTML i mean
> something like this in the code
>
>
> 
>  echo $this->Form->create('Employee',array('action'=>'edit'));
>echo $this->Form->input('id',array('type'=>'hidden'));
>echo $this->Form->input('emp_name');
>echo $this->Form->input('emp_email');
>echo $this->Form->input('emp_phone');
>echo $this->Form->input('emp_address');
>echo $this->Form->input('emp_joindate');
>   echo $this->Form->input('emp_dob');
>  ?>
> 
> find in the list
> finance
> marketing
> reserve
> deployment
> testing
> research
> 
> Form->end('Save');?>
>
> something like this... there must be a way to mix these 2 . after
> all its the POWER of PHP
>
> also can u please guide me to some links to read what can be done and
> what can't be done while mixing cakephp and php and html...
>
> thanks
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
*Taffarel de Lima Oliveira (Taffarelo3)*
*
*
*Desenvolvedor Web*

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: setFlash

2010-09-27 Thread Taffarel de Lima
você tem que setar o Helper Session no seu controller para que funcione o
metodo setFlash()

var $helpers = array('Session');

2010/9/26 Gilvan Jr. 

> Olá pessoal, aguem saberia me dizer o motivo:
>
> Notice (8): Undefined property: UsersController::$Session [APP
> \controllers\users_controller.php, line 50]
> Code | Context
> UsersController::edit() - APP\controllers\users_controller.php, line
> 50
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
>
> Fatal error: Call to a member function setFlash() on a non-object in D:
> \servidor\xampp\htdocs\cacex\app\controllers\users_controller.php on
> line 50
>
> Acontece nas actions, add, edit e delete.
>
> segue o meu código do controller:
>
>  class UsersController extends AppController {
>
>var $name = 'Users';
>
>function area_restrita(){
>
>}
>
>function login(){
>
>}
>
>function logout(){
>$this->redirect($this->Auth->logout()); // Efetuamos logout
>}
>
>function index() {
>$this->User->recursive = 0;
>$this->set('users', $this->paginate());
>}
>
>function view($id = null) {
>if (!$id) {
>$this->Session->setFlash(__('Invalid user', true));
>$this->redirect(array('action' => 'index'));
>}
>$this->set('user', $this->User->read(null, $id));
>}
>
>function add() {
>if (!empty($this->data)) {
>$this->User->create();
>if ($this->User->save($this->data)) {
>$this->Session->setFlash(__('The user has
> been saved', true));
>$this->redirect(array('action' => 'index'));
>} else {
>$this->Session->setFlash(__('The user could
> not be saved. Please,
> try again.', true));
>}
>}
>}
>
>function edit($id = null) {
>if (!$id && empty($this->data)) {
>$this->Session->setFlash(__('Invalid user', true));
>$this->redirect(array('action' => 'index'));
>}
>if (!empty($this->data)) {
>if ($this->User->save($this->data)) {
>$this->Session->setFlash(__('The user has
> been saved', true));
>$this->redirect(array('action' => 'index'));
>} else {
>$this->Session->setFlash(__('The user could
> not be saved. Please,
> try again.', true));
>}
>}
>if (empty($this->data)) {
>$this->data = $this->User->read(null, $id);
>}
>}
>
>function delete($id = null) {
>if (!$id) {
>$this->Session->setFlash(__('Invalid id for user',
> true));
>$this->redirect(array('action'=>'index'));
>}
>if ($this->User->delete($id)) {
>$this->Session->setFlash(__('User deleted', true));
>$this->redirect(array('action'=>'index'));
>}
>$this->Session->setFlash(__('User was not deleted', true));
>$this->redirect(array('action' => 'index'));
>}
> }
> ?>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en