cake-php
[Arriba] [Todas las Listas]

Re: Cómo para editar una vista en Pastel php

To: cake-php@xxxxxxxxxxxxxxxx
Subject: Re: Cómo para editar una vista en Pastel php
From: Ravinder Kaur <kaur.r87@xxxxxxxxx>
Date: Mon, 17 Jun 2013 12:30:54 -0700
Delivery-date: Mon, 17 Jun 2013 15:31:15 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:mime-version:in-reply-to:references:date:message-id :subject:from:to:x-original-sender:x-original-authentication-results :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=o5vP+R56dzK2WxjQl1NVq4JI2tZGIJVv19DWowevz8k=; b=K/Zdh/bN6kk5UT/L8ybHZCENfwN6kS6zieDOZo5J9rzzjHvuiJ4thCm+60FOHWHw9V HN8k+2KyqJ3nUrbr/xNvabKh17B9Wd2rsQBfkhAtVmXf5xitsRuAN+hiULaKGL5XIU55 CxXpbrkCFDZpAk0a7pgj8EECA8zdPb1U4NSueKEdtHne1TRZrxJ7Z5WLT0z2LVZj9Yqf UZ19ECeGkegDJglN936pbG8qMNxQBfw6zS5B2lMxf+khMwoDQxqOLNu6VblNsmho4tGx BZsEE2XqArpRhU9cqoASbi+witQPmyEW4sxhCkrlbF6JpEQLsNHUU46I3mgXsfatCdeH Z9Pw==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-beenthere:mime-version:in-reply-to:references:date:message-id :subject:from:to:x-original-sender:x-original-authentication-results :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=o5vP+R56dzK2WxjQl1NVq4JI2tZGIJVv19DWowevz8k=; b=WVcq0fJwPDXlEJzh/5slT0LFZlvyEPByO/xmlEnV5RaF8U8hmOgJZRPIOmhH5pgbk5 3rRrzgBtXb6QpZta4Hs6Yhuwes+eM4g4rzggVMnFIGfnBjAhpKxTYEKab5cnO8V/WVJI nWh9/ixmkYInHAFx5OKM5guVYyoH68e2HcVryQTn4mnn+3SwUaUaCjNV/nf2KQTx8xxR LKHZXkgnQm2hMYgBeRhjB0dom0tf/ePoa4DXnHA/7sLh8MQiO3ogb/obhhTGzE1aWo+3 UkAkabOnSb++Q0LuAxUNmfDJvEIKheHLNpjcGSUJX0oeBqYlcCVazIfvTCKpjxr2tiso 5WFg==
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <768acfe3-16cc-4f0d-8995-724e5ca2897b@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: <90c3adf6-6974-4870-a6d5-02b942d2f1fa@googlegroups.com> <0f2f857e-61ed-47bc-9c11-85e96a9b5272@googlegroups.com> <768acfe3-16cc-4f0d-8995-724e5ca2897b@googlegroups.com>
Reply-to: cake-php@xxxxxxxxxxxxxxxx
Sender: cake-php@xxxxxxxxxxxxxxxx
Estos son el Modelo, vista y archivos de controlador. Tengo que acceder nombre
de Cliente.
hay tres mesas: productos, clientes y *productfamilies.
Tiene que conseguir cliente_*id de *productfamilies mesa para cliente
y producto
correspondiente_nombre de los clientes que corresponden a cliente_*id.

*Thanks


En *Mon, *Jun 17, 2013 en 12:19 PM, Eric *Haskins <*ehask71@*xxxxxxxxx> escribió:

> No seguro cómo vuestro consiguiendo vuestra *$variedad *de productos
>
> podrías utilizar unos
>
> $productos = $esto-#nom}->encontrar('todo',variedad(
>
>     'une' => variedad(
>         variedad(
>             'mesa' => 'clientes',
>             '*alias' => '*CustomerJoin',
>             'tipo' => 'INTERIOR',
>             'condiciones' => variedad(
>                 '*CustomerJoin.Cliente_*id = *ProductFamily.Cliente_*id'
>             )
>         )
>     )));
>
> Otra vez yo *dont saber el código antes de que o vuestros nombres de mesa
>
> Eric
>
> En lunes, junio 17, 2013 1:37:38 PM *UTC-4, *Raks escribió:
>>
>> Tiene añadió una Columna nueva... Pero *m no capaz de conseguir un dato de columna de otro
>> modelo. Quiero nombre de mesa de clientes en vista de productos.*ctp.
>>
>> Aquí el código de vista:
>> *<?*php
>> $Variedad = de registros();
>> *foreach ($productos como $producto)
>>
>>     $#nom = ($producto['Producto']['es_activo'] == '1') ? 'Habilitado' :
>> 'Discapacitado';
>>
>>     $registros[] = variedad(
>>                         'Producto.Modelo' => variedad('título' =>
>> $producto['Producto']['modelo'], '*id' => $producto['Producto']['*id']),
>>                         'Producto.Parte_*num' =>
>> $producto['Producto']['parte_*num'],
>>                         '*ProductFamily.Nombre' =>
>> $producto['*ProductFamily']['nombre'],
>>                            // cliente de espectáculos *id.. Pero querer nombre de cliente
>> de mesa de clientes según cliente *id.
>>   //'Cliente.Nombre'=>$producto['*ProductFamily']['cliente_*id'],
>>                         'Producto.Hierro_*oem' => ($producto['Producto']['hierro_*oem'])
>> ?  'Sistemas de hierro':'Tercer Partido',
>>                         '*ProductType.Título' => $producto['*ProductType']['
>> título'],
>>                         'Producto.Es_activo' => $estado,
>>                     );
>> }
>>
>> $dato = *json_*encode($registros);
>> $*ret#nom:" . $Dato .",\*n";
>> $*ret .= "*pageInfo:#unknown{^*totalRowNum:" . $Total . "},\*n";
>> $*ret .= "*recordType : 'Variedad'}";
>> eco $*ret;
>> ?>*
>> En viernes, junio 7, 2013 11:40:19 SOY *UTC-7, *Raks escribió:
>>>
>>> *Hi,
>>>
>>> Tengo una pieza de código habiendo vista, modelo y controlador . Yo *nee *dto
>>> cambios de marca para ver sólo no en el *database.
>>> Así que cómo puede *i hacer aquello.  Necesito editar modelo y controlador también.
>>> Soy nuevo a *Cakephp y *MVC marco también.
>>>
>>> *Thanks.
>>>
>>  --
> Gustarnos en *FaceBook *https://www.facebook.com/*CakePHP
> nos Encuentra en *Twitter *http://*twitter.*com/*CakePHP
>
> ---
> Recibiste este mensaje porque eres *subscribed a un tema en
> el *Google Grupos "*CakePHP" grupo.
> A *unsubscribe de este tema, visita
> *https://grupos.*google.*com/*d/Pastel/de tema-*php/2*KJFo4*Ix7*Ew/*unsubscribe.
> A *unsubscribe de este grupo y todos sus temas, 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.
>
>
>



-- 
-------**Ravinder *Kaur*--------

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


These are the Model, view and controller files. I have to access Customer
name.
there are three tables: products, customers and productfamilies.
Have to get customer_id from productfamilies table for corresponding
product and
customer_name from customers corresponding to customer_id.

Thanks


On Mon, Jun 17, 2013 at 12:19 PM, Eric Haskins <ehask71@xxxxxxxxx> wrote:

> Not sure how your getting your *$products *array
>
> You could use a
>
> $products = $this->{Model}->find('all',array(
>
>     'joins' => array(
>         array(
>             'table' => 'customers',
>             'alias' => 'CustomerJoin',
>             'type' => 'INNER',
>             'conditions' => array(
>                 'CustomerJoin.customer_id = ProductFamily.customer_id'
>             )
>         )
>     )));
>
> Again I dont know the code before or your table names
>
> Eric
>
> On Monday, June 17, 2013 1:37:38 PM UTC-4, Raks wrote:
>>
>> Have added a new Column... but m not able to get a column data from other
>> model. I want name from customers table in products view.ctp.
>>
>> here's the view code:
>> *<?php
>> $records = array();
>> foreach ($products as $product){
>>
>>     $status = ($product['Product']['is_active'] == '1') ? 'Enabled' :
>> 'Disabled';
>>
>>     $records[] = array(
>>                         'Product.model' => array('title' =>
>> $product['Product']['model'], 'id' => $product['Product']['id']),
>>                         'Product.part_num' =>
>> $product['Product']['part_num'],
>>                         'ProductFamily.name' =>
>> $product['ProductFamily']['name'],
>>                            // shows customer id.. but want customer name
>> from customers table according to customer id.
>>   //'Customer.name'=>$product['ProductFamily']['customer_id'],
>>                         'Product.iron_oem' => ($product['Product']['iron_oem'])
>> ?  'Iron Systems':'Third Party',
>>                         'ProductType.title' => $product['ProductType']['
>> title'],
>>                         'Product.is_active' => $status,
>>                     );
>> }
>>
>> $data = json_encode($records);
>> $ret = "{data:" . $data .",\n";
>> $ret .= "pageInfo:{totalRowNum:" . $total . "},\n";
>> $ret .= "recordType : 'array'}";
>> echo $ret;
>> ?>*
>> On Friday, June 7, 2013 11:40:19 AM UTC-7, Raks wrote:
>>>
>>> Hi,
>>>
>>> I Have a piece of code having view, model and controller . I nee dto
>>> make changes to view only not in the database.
>>> So how can i do that. Do I need to edit model and controller as well.
>>> I am new to Cakephp and MVC framework too.
>>>
>>> Thanks.
>>>
>>  --
> 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/2KJFo4Ix7Ew/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>
>
>



-- 
-------*Ravinder Kaur*--------

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


<<attachment: ProductsController.php>>

<<attachment: Product.php>>

Attachment: json_listing.ctp
Description: Binary data

Attachment: listing.ctp
Description: Binary data

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