Skip to content

Quickstart

Harmen Janssen edited this page Aug 22, 2016 · 1 revision

Quickstart: Starting a project

1. Code base

Create a new project using Garp Scaffold.
Or git clone an existing one.
Run composer install to grab all dependencies.

2. Database

Create a UTF-8 MySQL database and call it project name + "_d". The name has to match the setting in /application/configs/db.ini:

[development]
...
resources.db.params.dbname = my_project_name_d

In your MySQL client, allow the Garp database user access to the database.

  • User: garp_development
  • Pass: welovegarp

3. Assets

Prepare the CDN. Make sure your asset files are distributed to S3:

$ g cdn distribute --to=development

4. Controller

Create some controller actions. If you're creating a new controller, make sure to add it to /application/configs/acl.ini as well. See ACL for more on that.

5. Routes

Make sure the url you're trying out is mentioned in /application/configs/routes.ini

6. Views

You'll need a view to render a template. Within /application/modules/default/views/scripts/ there should be a folder per controller. Inside should be a .phtml file, bearing the name of the controller action.

7. Snippets

Create some snippets in /application/configs/snippets.ini and call the snippet generator:

$ g snippet create from file

8. Models

Spawn your models.

9. Images

Set the necessary image scaling templates in /application/configs/assets.ini, in the same fashion as the cms_list and cms_preview templates already defined. After clearing your cache, you can use the scaling template when rendering an image in a view:

$this->image()->render($datatype->image_id, 'my_scaling_template');
Clone this wiki locally