Documentos de Académico
Documentos de Profesional
Documentos de Cultura
INTEGRANTES:
DOCENTE:
Ing. Carlo Corrales Delgado
2. DESARROLLO
En la carpeta root de nuestro proyecto en la ventana “cmd” (donde tiene que estar
composer.json). Ejecutar el siguiente comando:
$this->addPlugin('BootstrapUI');
Línea de comando :
bin\cake plugin load BootstrapUI
$this->addPlugin('BootstrapUI');
Figure 1 Pligin
USO
AppView Setup
Ubicación : src\View\AppView.php
• Dentro de nuestra clase AppView haremos uso del TRAIT use UIViewTrait, el
cual NOS AYUDARA A ACCEDER A CUALQUIER METODO Y ATRIBUTO DEL TRAIT.
namespace App\View;
use BootstrapUI\View\UIViewTrait;
use Cake\View\View;
use UIViewTrait;
BootstrapUI Layout
Antes de installar el pligin del bootstrap nuestras vistas tendrian este acpecto los
cuales son adguiridos del cake mediante sus layout .
Figure 2 layout
Como el cake tienen sus propias hojas de estilo las cuales se encuentran en la
carpeta de css ,la cual tiene la siguiente ruta src/webroot/css.
Ahora nosotros precederemos a cargar carpeta minificada de bootstrap.min.css ,así
también procedemos a cargar los jquery src/webroot/jq en su forma minificada
bootstrap.min.js
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc.
(https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
$cakeDescription = 'Facturacion';
?>
<!DOCTYPE html>
<html>
<head>
<?= $this->Html->charset() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
<?= $cakeDescription ?>:
<?= $this->fetch('title') ?>
</title>
<?= $this->Html->meta('icon') ?>
<?= $this->Html-
>css(['bootstrap.min.css','my_style.css','fontawesome.min.css']) ?>
<?= $this->Html->script(['jquery-
3.4.1.min.js','bootstrap.min.js','fontawesome.min.js']) ?>
</head>
<body>
<?= $this->element('menu') ?>
<div class="container">
<?= $this->Flash->render() ?>
<?= $this->fetch('content') ?>
</div>
<div>
<ul class ="top-bar-section">
<ul class="right">
</li>
<li><?= $this->Html->image("..\webroot\img\PE.png ",[
"alt"=>"español",
'url'=>['controller'=> 'App','action'=>'change-
language','es_PE']
]);?></li>
<li><?= $this->Html->image("",[
"alt"=>"portugues",
'url'=>['controller'=> 'App','action'=>'change-
language','pt_BR']
]);?></li>
</div>
<footer>
</footer>
</body>
</html>
Esta parte de código nos permite llamar a nuestro bootstrap que cargamos en la
carpeta css.
<?= $this->
Html->css(['bootstrap.min.css','my_style.css','fontawesome.min.css']) ?>
<?= $this->Html->script([
'jquery-3.4.1.min.js','bootstrap.min.js','fontawesome.min.js']) ?>
Podemos ver a simple vista que nuestra cabecera se encuentra mas ordenada .
1. Bibliografía
[1] CakePHP 3 Plugin BootStrap URL:
https://www.youtube.com/watch?v=htdkHk6endU