Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added note on disallowing queries or fragments in action uri

...

Code Block
languagephp
title/plugins/my_plugin/controllers/client_main.php
linenumberstrue
<?php
class ClientMain extends MyPluginController

    public function index() {
		// Set some variables to the view
		$this->set("var1", "value1");

		// Set variables all at once
		$var2 = "hello";
		$var3 = "world";
		$this->set(compact("var2", "var3"));

		// Automatically renders the view in /plugins/my_plugin/views/default/client_main.pdt
	}
}
?>
Note
titleQuery Parameters Not Allowed

The URI should be only the path (relative to the base URI) that does not include any query or fragments. See https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Examples

Note
titleNaming Convention

All Client controllers must start with client_ in their file name. The same is true for admins as well. All Admin controllers must start with admin_ in their file name. This tells Blesta which portal to render. Generic controllers (those not associated with a particular portal don't need any prefix.

...