See createproject
to create a project.
Tip
For all other commands, you must be in your project folder or one of its subfolders.
Important
The .ubiquity
folder created automatically with the project allows the devtools to find the root folder of the project. If it has been deleted or is no longer present, you must recreate this empty folder.
- command :
controller
- Argument :
controller-name
- aliases :
create-controller
short name | name | role | default | Allowed values |
---|---|---|---|---|
|
view | Creates the associated view index. |
|
true, false |
Samples: +++++++ Creates the controller controllers\ClientController
class in app/controllers/ClientController.php
:
Ubiquity controller ClientController
Creates the controller controllers\ClientController
class in app/controllers/ClientController.php
and the associated view in app/views/ClientController/index.html
:
Ubiquity controller ClientController -v
- command :
action
- Argument :
controller-name.action-name
- aliases :
new-action
short name | name | role | default | Allowed values |
---|---|---|---|---|
|
params | The action parameters (or arguments). | a,b=5 or $a,$b,$c | |
|
route | The associated route path. | /path/to/route | |
|
create-view | Creates the associated view. | false | true,false |
Samples: +++++++ Adds the action all
in controller Users
:
Ubiquity action Users.all
code result:
namespace controllers;
/**
* Controller Users
**/
class Users extends ControllerBase{
public function index(){}
public function all(){
}
}
Adds the action display
in controller Users
with a parameter:
Ubiquity action Users.display -p=idUser
The parameters must respect the php naming rules for the variables. | Br | You do not have to put the $ in front of the parameter names.
code result:
class Users extends ControllerBase{
public function index(){}
public function display($idUser){
}
}
Adds the action display
with an associated route:
Ubiquity action Users.display -p=idUser -r=/users/display/{idUser}
code result:
class Users extends ControllerBase{
public function index(){}
/**
*@route("/users/display/{idUser}")
**/
public function display($idUser){
}
}
Adds the action search
with multiple parameters:
Ubiquity action Users.search -p=name,address=''
code result:
class Users extends ControllerBase{
public function index(){}
/**
*@route("/users/display/{idUser}")
**/
public function display($idUser){
}
public function search($name,$address=''){
}
}
Adds the action search
and creates the associated view:
Ubiquity action Users.search -p=name,address -v
Note
Optionally check the database connection settings in the app/config/config.php file before running these commands.
To generate a model corresponding to the user table in database:
Ubiquity model user
For generating all models from the database:
Ubiquity all-models
To initialize the cache for routing (based on annotations in controllers) and orm (based on annotations in models) :
Ubiquity init-cache