Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *CONTROLADOR
- */
- class ProductosController extends ApplicationController
- {
- public function index()
- {
- $this->seccion = "productos";
- $this->css = "productos";
- $this->render("productos");
- }
- public function vajillas_porcelana()
- {
- $this->seccion = "productos";
- $this->productos_seccion = "vajilla_porcelana";
- $this->css = "productos";
- $this->render("vajilla_porcelana");
- }
- public function cubiertos()
- {
- /**
- * Prueba de inserción en bd
- */
- $marca = Load::model('marcas');
- $marca->nombre = "Mundial";
- $marca->descripcion = "Cuchillos Mundial";
- $marca->imagen = "/img/marcas/mundial.png";
- $marca->save();
- $this->seccion = "productos";
- $this->css = "productos";
- $this->prueba = "ajaaaa";
- $this->render("productos");
- }
- }
- /**
- *MODELO
- */
- class Marcas extends ActiveRecord
- {
- public function __construct()
- {
- $this->has_many('productos');
- }
- }
- /**
- * DATABASE.INI
- */
- [development]
- host = localhost
- username = root
- password =
- name = omalex
- type = mysqli
Add Comment
Please, Sign In to add comment