Skip to content

Commit

Permalink
Controller maker documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
WebBamboo committed Aug 13, 2019
1 parent 8c6b9e6 commit efe6a96
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 105 deletions.
1 change: 1 addition & 0 deletions _includes/footermenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
13 changes: 13 additions & 0 deletions docs/Controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Controller
---

I've created a version of the make:controller command which automatically adds the MaterialDashboard style to the controller. You can use it as follows:

```
php bin/console material-dashboard:make:controller
```

You use it the same way you'd use the regular MakerBundle make:controller command, just follow the wizard and you'll have your styled Controllers ready in no time.

{% include footermenu.html %}
1 change: 1 addition & 0 deletions docs/_includes/footermenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
1 change: 1 addition & 0 deletions docs/_site/Configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ <h2 id="step-by-step-explanation">Step by step explanation</h2>
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
16 changes: 16 additions & 0 deletions docs/_site/Controller.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<p>I’ve created a version of the make:controller command which automatically adds the MaterialDashboard style to the controller. You can use it as follows:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>php bin/console material-dashboard:make:controller
</code></pre></div></div>

<p>You use it the same way you’d use the regular MakerBundle make:controller command, just follow the wizard and you’ll have your styled Controllers ready in no time.</p>

<p><b>Table of contents: </b></p>
<ul>
<li><a href="/material-dashboard-symfony/Installation.html">Installation</a></li>
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
1 change: 1 addition & 0 deletions docs/_site/Crud.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
1 change: 1 addition & 0 deletions docs/_site/Installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
200 changes: 95 additions & 105 deletions docs/_site/Notifications.html
Original file line number Diff line number Diff line change
@@ -1,112 +1,101 @@
<p>A simple notifications system is bundled with this code, you can easily modify it if needed or implement your own. In order to make use of it you have to go through a few steps:</p>
<ol>
<li>Create the Notification Entity. IMPORTANT Note that this system assumes your user entity is App\Entity\User adjust if needed:
```
&lt;?php</li>
<li>Create the Notification Entity. IMPORTANT Note that this system assumes your user entity is App\Entity\User adjust if needed:</li>
</ol>

<p>namespace App\Entity;</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;?php

<p>use Doctrine\ORM\Mapping as ORM;
use Webbamboo\MaterialDashboard\Model\NotificationInterface;</p>
namespace App\Entity;

<p>/**</p>
<ul>
<li>@ORM\Entity(repositoryClass=”App\Repository\NotificationRepository”)
use Doctrine\ORM\Mapping as ORM;
use Webbamboo\MaterialDashboard\Model\NotificationInterface;

/**
* @ORM\Entity(repositoryClass="App\Repository\NotificationRepository")
*/
class Notification implements NotificationInterface
{
/**
<ul>
<li>@ORM\Id()</li>
<li>@ORM\GeneratedValue()</li>
<li>@ORM\Column(type=”integer”)
*/
private $id;</li>
</ul>

<p>/**</p>
<ul>
<li>@ORM\ManyToOne(targetEntity=”App\Entity\User”, inversedBy=”notifications”)
*/
private $user;</li>
</ul>

<p>/**</p>
<ul>
<li>@ORM\Column(type=”array”, nullable=true)
*/
private $data = [];</li>
</ul>

<p>/**</p>
<ul>
<li>@ORM\Column(type=”text”)
*/
private $description;</li>
</ul>

<p>/**</p>
<ul>
<li>@ORM\Column(type=”datetimetz”)
*/
private $created;</li>
</ul>

<p>public function getId(): ?int
{
return $this-&gt;id;
}</p>

<p>public function getUser(): ?User
{
return $this-&gt;user;
}</p>

<p>public function setUser(?User $user): self
{
$this-&gt;user = $user;</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> return $this; }
</code></pre></div> </div>

<p>public function getData(): ?array
{
return $this-&gt;data;
}</p>

<p>public function setData(?array $data): self
{
$this-&gt;data = $data;</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> return $this; }
</code></pre></div> </div>

<p>public function getDescription(): ?string
{
return $this-&gt;description;
}</p>

<p>public function setDescription(string $description): self
{
$this-&gt;description = $description;</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> return $this; }
</code></pre></div> </div>

<p>public function getCreated(): ?\DateTimeInterface
{
return $this-&gt;created;
}</p>

<p>public function setCreated(\DateTimeInterface $created): self
{
$this-&gt;created = $created;</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> return $this; } } ```
</code></pre></div> </div>
</li>
</ul>
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="notifications")
*/
private $user;

/**
* @ORM\Column(type="array", nullable=true)
*/
private $data = [];

/**
* @ORM\Column(type="text")
*/
private $description;

/**
* @ORM\Column(type="datetimetz")
*/
private $created;

public function getId(): ?int
{
return $this-&gt;id;
}

public function getUser(): ?User
{
return $this-&gt;user;
}

public function setUser(?User $user): self
{
$this-&gt;user = $user;

return $this;
}

public function getData(): ?array
{
return $this-&gt;data;
}

public function setData(?array $data): self
{
$this-&gt;data = $data;

return $this;
}

public function getDescription(): ?string
{
return $this-&gt;description;
}

public function setDescription(string $description): self
{
$this-&gt;description = $description;

return $this;
}

public function getCreated(): ?\DateTimeInterface
{
return $this-&gt;created;
}

public function setCreated(\DateTimeInterface $created): self
{
$this-&gt;created = $created;

return $this;
}
}
</code></pre></div></div>

<ol>
<li>Once that is done update your database running:
Expand All @@ -122,13 +111,13 @@
Webbamboo\MaterialDashboard\Model\NotificationInterface: App\Entity\Notification
</code></pre></div> </div>
</li>
<li>Once the configuration is done you can clear the cache and run the following command to test the notification system:
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>php bin/console cache:clear
php bin/console material-dashboard:test-notification
</code></pre></div> </div>
</li>
<li>Once the configuration is done you can clear the cache and run the following command to test the notification system:</li>
</ol>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>php bin/console cache:clear
php bin/console material-dashboard:test-notification
</code></pre></div></div>

<p>Now the user you’ve chosen in the command wizard will get the notification in their dashboard. Usually the notifications appear within 15 seconds without refresh.</p>

<p><b>Table of contents: </b></p>
Expand All @@ -137,5 +126,6 @@
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
1 change: 1 addition & 0 deletions docs/_site/Usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,6 @@ <h3 id="table-helper">Table Helper</h3>
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>
1 change: 1 addition & 0 deletions docs/_site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<li><a href="/material-dashboard-symfony/Configuration.html">Configuration</a></li>
<li><a href="/material-dashboard-symfony/Usage.html">Usage</a></li>
<li><a href="/material-dashboard-symfony/Crud.html">CRUD</a></li>
<li><a href="/material-dashboard-symfony/Controller.html">Controller</a></li>
<li><a href="/material-dashboard-symfony/Notifications.html">Notifications</a></li>
</ul>

0 comments on commit efe6a96

Please sign in to comment.