Guest User

Untitled

a guest
Apr 11th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. /**
  2.  *CONTROLADOR
  3. */
  4. class ProductosController extends ApplicationController
  5. {
  6.     public function index()
  7.     {
  8.         $this->seccion = "productos";
  9.         $this->css = "productos";
  10.         $this->render("productos");
  11.     }
  12.  
  13.  
  14.  
  15.     public function vajillas_porcelana()
  16.     {
  17.         $this->seccion = "productos";
  18.         $this->productos_seccion = "vajilla_porcelana";
  19.         $this->css = "productos";
  20.         $this->render("vajilla_porcelana");
  21.     }
  22.  
  23.     public function cubiertos()
  24.     {
  25.         /**
  26.          * Prueba de inserción en bd
  27.          */
  28.         $marca = Load::model('marcas');
  29.         $marca->nombre = "Mundial";
  30.         $marca->descripcion = "Cuchillos Mundial";
  31.         $marca->imagen = "/img/marcas/mundial.png";
  32.         $marca->save();
  33.         $this->seccion = "productos";
  34.         $this->css = "productos";
  35.         $this->prueba = "ajaaaa";
  36.         $this->render("productos");
  37.     }
  38.  
  39. }
  40. /**
  41.  *MODELO
  42. */
  43. class Marcas extends ActiveRecord
  44. {
  45.  
  46.     public function __construct()
  47.     {
  48.         $this->has_many('productos');
  49.     }
  50. }
  51. /**
  52.  * DATABASE.INI
  53. */
  54. [development]
  55. host = localhost
  56. username = root
  57. password =
  58. name = omalex
  59. type = mysqli
Add Comment
Please, Sign In to add comment