Ejemplo de Codigo
Versión 1 (Guillermo Zdanowicz, 18/04/2017 09:18)
1 | 1 | Guillermo Zdanowicz | h1. Ejemplo de Codigo |
---|---|---|---|
2 | 1 | Guillermo Zdanowicz | |
3 | 1 | Guillermo Zdanowicz | VISTA |
4 | 1 | Guillermo Zdanowicz | |
5 | 1 | Guillermo Zdanowicz | <pre> |
6 | 1 | Guillermo Zdanowicz | @extends('master') |
7 | 1 | Guillermo Zdanowicz | |
8 | 1 | Guillermo Zdanowicz | @section('titulo','Listado de Cuentas') |
9 | 1 | Guillermo Zdanowicz | @section('contenido') |
10 | 1 | Guillermo Zdanowicz | |
11 | 1 | Guillermo Zdanowicz | <h1> CUENTAS </h1> |
12 | 1 | Guillermo Zdanowicz | |
13 | 1 | Guillermo Zdanowicz | <? //{{ $resultado }} ?> |
14 | 1 | Guillermo Zdanowicz | |
15 | 1 | Guillermo Zdanowicz | <ul> |
16 | 1 | Guillermo Zdanowicz | @foreach($resultado as $item) |
17 | 1 | Guillermo Zdanowicz | <li> {{ $item->id }} - {{ $item->descripcion }} </li> |
18 | 1 | Guillermo Zdanowicz | @endforeach |
19 | 1 | Guillermo Zdanowicz | </ul> |
20 | 1 | Guillermo Zdanowicz | |
21 | 1 | Guillermo Zdanowicz | @endsection |
22 | 1 | Guillermo Zdanowicz | </pre> |
23 | 1 | Guillermo Zdanowicz | |
24 | 1 | Guillermo Zdanowicz | CONTROLADOR |
25 | 1 | Guillermo Zdanowicz | |
26 | 1 | Guillermo Zdanowicz | |
27 | 1 | Guillermo Zdanowicz | |
28 | 1 | Guillermo Zdanowicz | MODELO |
29 | 1 | Guillermo Zdanowicz | |
30 | 1 | Guillermo Zdanowicz | <pre> |
31 | 1 | Guillermo Zdanowicz | namespace App; |
32 | 1 | Guillermo Zdanowicz | use App\T_cuentas_persona; |
33 | 1 | Guillermo Zdanowicz | use Illuminate\Database\Eloquent\Model; |
34 | 1 | Guillermo Zdanowicz | |
35 | 1 | Guillermo Zdanowicz | class T_cuentas_persona extends Model |
36 | 1 | Guillermo Zdanowicz | { |
37 | 1 | Guillermo Zdanowicz | public static function buscarcuentapersona($id) |
38 | 1 | Guillermo Zdanowicz | { |
39 | 1 | Guillermo Zdanowicz | return t_cuentas_persona::where('idpersona', $id)->join('t_cuentas as tc','idcuenta','=','tc.id')->get(); |
40 | 1 | Guillermo Zdanowicz | } |
41 | 1 | Guillermo Zdanowicz | |
42 | 1 | Guillermo Zdanowicz | } |
43 | 1 | Guillermo Zdanowicz | </pre> |
44 | 1 | Guillermo Zdanowicz | |
45 | 1 | Guillermo Zdanowicz | LAYOUT PERSONALIZADO |
46 | 1 | Guillermo Zdanowicz | |
47 | 1 | Guillermo Zdanowicz | <pre> |
48 | 1 | Guillermo Zdanowicz | <!DOCTIPE html> |
49 | 1 | Guillermo Zdanowicz | <html> |
50 | 1 | Guillermo Zdanowicz | |
51 | 1 | Guillermo Zdanowicz | <head> |
52 | 1 | Guillermo Zdanowicz | <title>App - @yield('titulo')</title> |
53 | 1 | Guillermo Zdanowicz | </head> |
54 | 1 | Guillermo Zdanowicz | <body> |
55 | 1 | Guillermo Zdanowicz | <h1>Logo</h1> |
56 | 1 | Guillermo Zdanowicz | @yield('contenido') |
57 | 1 | Guillermo Zdanowicz | </body> |
58 | 1 | Guillermo Zdanowicz | </html> |
59 | 1 | Guillermo Zdanowicz | </pre> |
60 | 1 | Guillermo Zdanowicz | |
61 | 1 | Guillermo Zdanowicz | ROUTING |
62 | 1 | Guillermo Zdanowicz | |
63 | 1 | Guillermo Zdanowicz | <pre> |
64 | 1 | Guillermo Zdanowicz | /** |
65 | 1 | Guillermo Zdanowicz | * Cuentas Personas |
66 | 1 | Guillermo Zdanowicz | */ |
67 | 1 | Guillermo Zdanowicz | |
68 | 1 | Guillermo Zdanowicz | Route::resource('t_cuentas_personas', 'T_cuentas_personasController'); |
69 | 1 | Guillermo Zdanowicz | Route::get('t_cuentas_personas/vercuentas/{id}','T_cuentas_personasController@obtenercuentas'); |
70 | 1 | Guillermo Zdanowicz | Route::get('vercuentas/{id}','cuentaspersonasController@vercuentas'); |
71 | 1 | Guillermo Zdanowicz | </pre> |