Skip to content

Workflow

Dave Stewart edited this page Apr 5, 2017 · 5 revisions

Sketchpad workflow entails creating and editing controllers, and interacting with them in the front-end.

image

Adding code to a project

Adding code to Sketchpad is as simple as creating controllers and adding methods.

You can view controllers from anywhere in your project. The default install shows the following controller folders:

sketchpad/controllers
vendor/davestewart/sketchpad/src/help

You can add as many folders, controllers and methods as you like.

Editing code

Anything you write in your editor will show verbatim in the front end:

  • Controllers and methods will show in a list on the left
  • Method name and doc comments will show as metadata on the right
  • Optional method parameters will show as UI controls below that
  • Echo or return data from methods to output in the UI

Interacting with code

image

To display interactive parameter inputs in the front end from with which to pass values to the back end, provide pre-filled optional parameters in your method signatures:

public function typeCasting($string = 'hello', $number = 1, $boolean = true)
{
    // do something with parameters
}

Note that Sketchpad controllers are run through the same system as standard Laravel controllers, so support dependency injection, route model binding and middleware.

Live reload IDE changes

If you have the companion Sketchpad Reload module installed, as you save your files and have the results are transparently loaded back into Sketchpad.

This 2-way update makes it quick and easy to develop code in an interactive manner.

Clone this wiki locally