cake-php
[Arriba] [Todas las Listas]

Re: 1 controlador 2 modelos

To: cake-php@xxxxxxxxxxxxxxxx
Subject: Re: 1 controlador 2 modelos
From: hdogan <hdogan@xxxxxxxxx>
Date: Tue, 25 Jun 2013 07:31:55 -0700 (PDT)
Delivery-date: Tue, 25 Jun 2013 11:10:01 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=ffQs22Y1z9dJVyislzFC56DpgvxaGq9E3d19ohnXwwU=; b=HPR1R+KmxxkZnMsANCNuHLFSE27GFRrPWdLYs7pSJ+XXa3gH08+VMDmmz2chbyM3zZ GM+lpxpK6w0h7aje3ZG4at+l+wBzNFgMQ9xexlsJoYvC0tQ1r2/oYFWA/oFQRXO2WGGR NlfuaZ6nS0FNb/QU3LQDu6SwJCnOhjkUxR53MR2VYd0IZ8+qhy4E70MjBECSVO6Hh8Di SStBsMLHPqVjoLJWgC8DYDPWsIp6cGTKsYcZaPVmP2oNP00t9bcr0KHUYqaBWBLJKqYz Y27AJElG1DgseOsJnh+PNQ8Hds0Rb2NPwTjM3A6B+1tRHG5C3+bVYHXgcCzzH2bPFwT4 upQw==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=ffQs22Y1z9dJVyislzFC56DpgvxaGq9E3d19ohnXwwU=; b=KsH+cDcDJYAtYUTIM8+Z42RWm7D8gY1BDSnT1+XXRcdee7PSYV5dLXMet5EDTtvJgN Hgb4WAQj1F4rK5gGLyrfymjniAYqcnioS9ZQ8Crd7minC+282De91nwwnNRuSlN26R6/ d9mirfyI/7H6Z/AwW2ynRlBQOtEASeDZSfXN5ReJNdD3EXVNCJ12+/J4zRKN1dvGMvBJ 6iOpKkOC447+sXBJPapFyHvqC/p9S/8EMGxfZ35RlA/0myRhLNiSY5mwKScZ/Q3HP/Cj mKr41+wyj6A58tA0H3QW60AGFy10wG9UBriUoS68kn9SMAvcGMmTNfAzzhVL0wrslLHy A9/Q==
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <ad3ad23f-ed19-47cf-86ea-289e6a7a4ed7@googlegroups.com>
List-archive: <http://groups.google.com/group/cake-php>
List-help: <http://groups.google.com/support/>, <mailto:cake-php+help@googlegroups.com>
List-id: <cake-php.googlegroups.com>
List-post: <http://groups.google.com/group/cake-php/post>, <mailto:cake-php@googlegroups.com>
List-subscribe: <http://groups.google.com/group/cake-php/subscribe>, <mailto:cake-php+subscribe@googlegroups.com>
List-unsubscribe: <http://groups.google.com/group/cake-php/subscribe>, <mailto:googlegroups-manage+1003367825667+unsubscribe@googlegroups.com>
Mailing-list: list cake-php@xxxxxxxxxxxxxxxx; contact cake-php+owners@xxxxxxxxxxxxxxxx
References: <ad3ad23f-ed19-47cf-86ea-289e6a7a4ed7@googlegroups.com>
Reply-to: cake-php@xxxxxxxxxxxxxxxx
Sender: cake-php@xxxxxxxxxxxxxxxx
Puedes utilizar $propiedad de usos de vuestro controlador para utilizar modelos múltiples o *ClassRegistry::*init() 
método para cargar vuestro modelo donde lo utilizas.

Clase *YourController extiende *AppController
    #adj_nom_nom $de usos = públicos('Modelo1', 'Modelo2');
}

o función 

pública un()
     $#verbcj1 = *ClassRegistry::*init('Modelo1')->encontrar('todo'); // si Modelo1 
no es *default modelo de vuestro controlador
}

función pública dos()
    $#verbcj2 = *ClassRegistry::*init('Modelo2')->encontrar('todo'); // si Modelo2 no 
es *default modelo de vuestro controlador
}


En martes, junio 25, 2013 5:09:05 PM *UTC+3, Carlos Antonio escribió:
>
> *Tenho 2 modelos (*cautela *E *acesso) *e 1 controlador (*cautela).
>
> *Como *informar *ao Controlador *aqueles modelos?
>
> Un *ideia *é un *seguinte:
>
> Modelo '*acesso': *funçõ*es *de *login (*vai *pra *cautela) *e *de *logout (*sai *de 
> *cautela);
>
> Modelo '*cautela': *toda un *funcionalidade  *sistema *necessário (*esta *parte 
> *tá *ok)!!!
>
> *Obrigado.
>

-- 
Gustarnos en *FaceBook *https://www.facebook.com/*CakePHP
nos Encuentra en *Twitter *http://*twitter.*com/*CakePHP

--- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*CakePHP" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a pastel-*php+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a pastel-php@xxxxxxxxxxxxxxxx.
Visita este grupo en *http://grupos.*google.*com/Pastel/de grupo-*php.
Para más opciones, visita *https://grupos.*google.*com/Los Grupos/optan_fuera.


You can use $uses property of your controller to use multiple models or 
ClassRegistry::init() method to load your model where you use it.

class YourController extends AppController {
    public $uses = array('Model1', 'Model2');
}

or 

public function one() {
     $results1 = ClassRegistry::init('Model1')->find('all'); // if Model1 
is not default model of your controller
}

public function two() {
    $results2 = ClassRegistry::init('Model2')->find('all'); // if Model2 is 
not default model of your controller
}


On Tuesday, June 25, 2013 5:09:05 PM UTC+3, Carlos Antonio wrote:
>
> Tenho 2 models (cautela E acesso) e 1 controller (cautela).
>
> Como informar ao controller aqueles models?
>
> A ideia é a seguinte:
>
> Model 'acesso': funções de login (vai pra cautela) e de logout (sai de 
> cautela);
>
> Model 'cautela': toda a funcionalidade do sistema necessário (esta parte 
> tá ok)!!!
>
> Obrigado.
>

-- 
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+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


<Anterior por Tema] Tema Actual [Siguiente por Tema>