This is a list of the methods you can use in an Action and an explanation of what they do
Note: This method is required in your Action class. Also there are File Extension SVG which stand for scalable vector graphics
This will execute any application/business logic for the action. This method is reached only after the request methods have been checked and any of the parameters have been validated.
When leaving, the execute() method should tell the controller what view is to be used. This is done by returning a string containing the view name associated with the action or an array of the parent module for the view to be executed, parent action for the view and the name of the view. I will show an example of return both in a later tutorial.
This is a new feature in Mojavi 3. Basically, a credentials are a privilege array that describes any level of security. They work hand in hand with the security aspects of the User class. For Mojavi 2 users, note that this replaces the old Privileges. But it is also important to know that it can do more than just handle privileges. I will handle the usage of creditials in a later section. For now, it is sufficient to know that we set the creditial requirements for the action inside this method and that it is set to NULL by default.
This is the view that will be executed when a given request is not served by the action. This could happen when a form being displayed for the first time or if we are displaying a static page. Be sure to reset any variable in the graphic engine and search out the File Extension SVG portions by using a simple search.
Again, just as with the execute() methoad, a string with a view name or an array of a module/action/view is passed back to the controller. By default it will pass back View::INPUT
You can also return a view from another module. You do this by passing an array with the view information instead of the standard View::INPUT. When you use this you create a two element array. The first element is the module name. The second element is which view you want. It cannot be just the Action name, but the file extension Action name with the specific view.
Here’s an example:
class MyClass extends Action
$returnView = MyModule;
$returnView = DoSomethingInput;
$returnView = DoSomethingError;
$returnView = DoSomething;
I’ll add more to this later, describing the View class.