Sie sind auf Seite 1von 3

Migrations command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose
output and 3 for debug

Available commands:
create Create a new migration
dump Dumps the current schema of the database to be used while baking a diff
help Displays help for a command
list Lists commands
mark_migrated Mark a migration as migrated
migrate Migrate the database
orm-cache-build Build all metadata caches for the connection. If a table name is provided, only that
table will be cached.
orm-cache-clear Clear all metadata caches for the connection. If a table name is provided, only that
table will be removed.
rollback Rollback the last or to a specific migration
seed Seed the database with data
status Show migration status

crear tabla

bin/cake bake Migration create_bookmarks title:string description: text url:text created modified

RUTAS Y CONTROLADORES

//RUTAS USUARIOS
//DENTRO DE LA CARPETA ROUTES
//Router::Connect('/users/index', ['controller' => 'Users', 'action' => 'index']);
/**
* Load all plugin routes. See the Plugin documentation on
* how to customize the loading of plugin routes.
*/
Router::scope('/users', function ($routes){
$routes ->connect('index',['controller' => 'users', 'action' => 'index']);
$routes ->connect('view/*',['controller' => 'users', 'action' => 'view']);
});

//DENTRO DE LA CARPETA UsersController


<?php
namespace App\Controller;
use App\Controller\AppController;

/**
* Users Controller
*
*/
class UsersController extends AppController
{
public function index()
{
echo "Listado de Usuarios";
exit();
}
public function view($name)
{
echo "Detalle de Usuario " , $name ;
exit();
}
public function add()
{
echo "agregar usuario";
exit();
}
}
LISTADO Y PAGINACION DE REGISTROS VIDEO 6
///
<?php
namespace App\Controller;

use App\Controller\AppController;

/**
* Users Controller
*
*/
class UsersController extends AppController
{
public function index()
{
$users = $this->Users->find('all');
$this->set('Users', $users);
}
public function view($name)
{
echo "Detalle de Usuario " , $name ;
exit();
}
public function add()
{
echo "agregar usuario";
exit();
}
}

dentro de index.ctp

<h1>Users</h1>
<ul>
<?php foreach ($Users as $user): ?>
<li>
<?= $user->email ?>
</li>
<li>
<?= $user->id ?>
</li>
<?php endforeach;?>
</ul>
}

Das könnte Ihnen auch gefallen