update theme
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-02-09 21:50:06 +01:00
parent 29a562441f
commit 385af624a6
Signed by: deblan
GPG key ID: 579388D585F70417
23 changed files with 150 additions and 195 deletions

4
.env Normal file
View file

@ -0,0 +1,4 @@
LIVE_RELOAD_SUPPORT=true
ADD_MODULES=mkdocs-material
DOCS_DIRECTORY=/app
FAST_MODE=false

View file

@ -2,6 +2,7 @@ pipeline:
build: build:
image: polinux/mkdocs image: polinux/mkdocs
commands: commands:
- pip install mkdocs-material
- mkdocs build - mkdocs build
deploy: deploy:
image: eeacms/rsync image: eeacms/rsync

View file

@ -1,37 +1 @@
.wy-side-nav-search .icon::before {
content: ' ';
display: block;
background: url(/_static/img/logo.svg) no-repeat center center;
background-size: contain;
width: 100%;
height: 80px;
margin-bottom: 10px;
}
.wy-menu p.caption {
margin-top: 10px;
}
table {
margin-bottom: 15px;
}
td, th {
padding: 5px 10px;
}
td code {
border: 0 !important;
}
.wy-nav-content {
max-width: inherit;
}
.wy-nav-side {
background: #262e3d;
}
.wy-menu-vertical a:hover {
background: #1e2430;
}

View file

@ -28,9 +28,7 @@ Go the navigation and edit the tested node:
The event subscriber helps you to define each variation and the TTL. The event subscriber helps you to define each variation and the TTL.
``` ```php-inline title="src/EventSubscriber/MyAbTestEventSubscriber.php"
// src/EventSubscriber/MyAbTestEventSubscriber.php
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Core\EventSubscriber\AbEventSubscriber as EventSubscriber; use App\Core\EventSubscriber\AbEventSubscriber as EventSubscriber;
@ -63,7 +61,7 @@ class MyAbTestEventSubscriber extends EventSubscriber
you can retrieve the test and the variation picked in PHP side and in template side. you can retrieve the test and the variation picked in PHP side and in template side.
``` ```php-inline
use App\Core\Ab\AbContainerInterface; use App\Core\Ab\AbContainerInterface;
public function foo(AbContainerInterface $testContainer) public function foo(AbContainerInterface $testContainer)
@ -81,7 +79,7 @@ public function foo(AbContainerInterface $testContainer)
} }
``` ```
``` ```twig
{% if ab_test_exists('example_test') %} {% if ab_test_exists('example_test') %}
{% set test = ab_test('example_test') %} {% set test = ab_test('example_test') %}
{% set result = ab_test_result('example_test') %} {% set result = ab_test_result('example_test') %}
@ -95,9 +93,7 @@ public function foo(AbContainerInterface $testContainer)
If you need to perform an A/B test everywhere, you need to create a specific listener: If you need to perform an A/B test everywhere, you need to create a specific listener:
``` ```php-inline title="src/EventListener/CustomAbListener.php"
// src/EventListener/CustomAbListener.php
namespace App\EventListener; namespace App\EventListener;
use App\Core\EventListener\AbListener as EventListener; use App\Core\EventListener\AbListener as EventListener;
@ -126,9 +122,7 @@ class CustomAbListener extends EventListener
`CustomAbListener` must be registred: `CustomAbListener` must be registred:
``` ```yaml title="config/services.yml"
# config/services.yml
services: services:
# ... # ...

View file

@ -7,8 +7,7 @@ The default controller of a node is `App\Core\Controller\Site\PageController::sh
To create a custom controller, do this way: To create a custom controller, do this way:
``` ```php-inline title="src/Controller/MyController.php"
// src/Controller/MyController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Controller\Site\PageController; use App\Core\Controller\Site\PageController;
@ -30,7 +29,7 @@ class MyController extends PageController
Then edit `config/packages/app.yaml` and add your controller: Then edit `config/packages/app.yaml` and add your controller:
``` ```yaml
core: core:
site: site:
controllers: controllers:
@ -41,8 +40,7 @@ core:
If your controller represents entities and if the associated node is visible in the sitemap, you can use a `App\Core\Annotation\UrlGenerator` in annotations and implement a generator. See the example below. If your controller represents entities and if the associated node is visible in the sitemap, you can use a `App\Core\Annotation\UrlGenerator` in annotations and implement a generator. See the example below.
``` ```php-inline title="src/UrlGenerator/MyEntityGenerator"
// src/UrlGenerator/MyEntityGenerator
namespace App\UrlGenerator; namespace App\UrlGenerator;
use App\Core\Entity\Site\Node; use App\Core\Entity\Site\Node;
@ -84,8 +82,7 @@ class MyEntityGenerator
Then, the have to annotate the controller like this (note: `options` is optional): Then, the have to annotate the controller like this (note: `options` is optional):
``` ```php-inline title="src/Controller/MyController.php"
// src/Controller/MyController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Annotation\UrlGenerator; use App\Core\Annotation\UrlGenerator;
@ -104,7 +101,7 @@ class MyController extends PageController
Finally, update `config/services.yaml`: Finally, update `config/services.yaml`:
``` ```yaml
services: services:
# ... # ...

View file

@ -6,8 +6,7 @@ The entity manager of Muprh is a proxy of the Doctrine's entity manager. It give
Entities must implements `App\Core\Entity\EntityInterface`. Entities must implements `App\Core\Entity\EntityInterface`.
``` ```php-inline title="src/Entity/MyEntity.php"
// src/Entity/MyEntity.php
namespace App\Entity; namespace App\Entity;
use App\Repository\MyEntityRepository; use App\Repository\MyEntityRepository;
@ -30,8 +29,7 @@ There are 2 entity managers which are services:
* `App\Core\Manager\EntityManager` used for all entities * `App\Core\Manager\EntityManager` used for all entities
* `App\Core\Manager\TranslatableEntityManager` used for translatable entities * `App\Core\Manager\TranslatableEntityManager` used for translatable entities
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Manager\EntityManager use App\Core\Manager\EntityManager
@ -62,8 +60,7 @@ class FooController
Events are dispatched before and after creation, update and deletion. All entities of Muprh use the entity manager. Events are dispatched before and after creation, update and deletion. All entities of Muprh use the entity manager.
``` ```php-inline title="src/EventSubscriber/MyEntityEventSubscriber.php"
// src/EventSubscriber/MyEntityEventSubscriber.php
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Core\Entity\EntityInterface; use App\Core\Entity\EntityInterface;

View file

@ -16,8 +16,7 @@ Simply run `php bin/console make:factory`.
## Usage ## Usage
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Factory\MyEntityFactory; use App\Factory\MyEntityFactory;

View file

@ -6,8 +6,7 @@ A Repository query is an abstraction of the doctrine repository.
Entities must implements `App\Core\Entity\EntityInterface`. Entities must implements `App\Core\Entity\EntityInterface`.
``` ```php-inline title="src/Entity/MyEntity.php"
// src/Entity/MyEntity.php
namespace App\Entity; namespace App\Entity;
use App\Repository\MyEntityRepository; use App\Repository\MyEntityRepository;
@ -34,8 +33,7 @@ Simply run `php bin/console make:repository-query`.
Each entity has its own repository query which is a service. Each entity has its own repository query which is a service.
``` ```php-inline title="src/Repository/MyEntityRepositoryQuery"
// src/Repository/MyEntityRepositoryQuery;
namespace App\Repository; namespace App\Repository;
use App\Core\Repository\RepositoryQuery; use App\Core\Repository\RepositoryQuery;
@ -66,8 +64,7 @@ class MyEntityRepositoryQuery extends RepositoryQuery
You are able to find entities in an easy way, without knowing the identification variable and without creating a query builder. You are able to find entities in an easy way, without knowing the identification variable and without creating a query builder.
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Repository\MyEntityRepositoryQuery use App\Repository\MyEntityRepositoryQuery
@ -93,7 +90,7 @@ class FooController
## Custom methods ## Custom methods
``` ```php-inline
// ... // ...
class MyEntityRepositoryQuery extends RepositoryQuery class MyEntityRepositoryQuery extends RepositoryQuery
@ -113,7 +110,7 @@ class MyEntityRepositoryQuery extends RepositoryQuery
} }
``` ```
``` ```php-inline
$entities = $query->create() $entities = $query->create()
->filterByFoo($foo, $bar) ->filterByFoo($foo, $bar)
->find(); ->find();
@ -123,6 +120,6 @@ $entities = $query->create()
You can paginate entities (`Knp\Component\Pager\Pagination\PaginationInterface`): You can paginate entities (`Knp\Component\Pager\Pagination\PaginationInterface`):
``` ```php-inline
$pager = $query->create()->paginate($page, $maxPerPage); $pager = $query->create()->paginate($page, $maxPerPage);
``` ```

View file

@ -13,7 +13,7 @@
Depending of you environment, PHP and composer could be located in specific paths. Depending of you environment, PHP and composer could be located in specific paths.
Defines theme with environment vars: Defines theme with environment vars:
``` ```bash
export PHP_BIN=/usr/bin/php export PHP_BIN=/usr/bin/php
export COMPOSER_BIN=/usr/bin/composer export COMPOSER_BIN=/usr/bin/composer
export NPM_BIN=/usr/bin/npm export NPM_BIN=/usr/bin/npm
@ -22,7 +22,7 @@ export YARN_BIN=/usr/bin/yarn
Create your project: Create your project:
``` ```bash
"$COMPOSER_BIN" create-project murph/murph-skeleton my_project ^1 "$COMPOSER_BIN" create-project murph/murph-skeleton my_project ^1
``` ```

View file

@ -9,8 +9,7 @@ A setting's value is stored in json so a value could be a string, a boolean, an
See the example below. See the example below.
``` ```php-inline title="src/EventSubscriber/SettingEventSubscriber.php"
// src/EventSubscriber/SettingEventSubscriber.php
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Core\Event\Setting\SettingEvent; use App\Core\Event\Setting\SettingEvent;
@ -72,8 +71,7 @@ Result:
Settings are accessible using `App\Core\Setting\SettingManager` which is a service. Settings are accessible using `App\Core\Setting\SettingManager` which is a service.
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Setting\SettingManager; use App\Core\Setting\SettingManager;
@ -94,7 +92,7 @@ class FooController
In a template, you can use the function `setting`: In a template, you can use the function `setting`:
``` ```twig
Font color: {{ setting('app_font_color') }}<br> Font color: {{ setting('app_font_color') }}<br>
Background color: {{ setting('app_background_color') }}<br> Background color: {{ setting('app_background_color') }}<br>
Maintenance enabled: {{ setting('app_maintenance_enabled') ? 'Yes' : 'No' }}<br> Maintenance enabled: {{ setting('app_maintenance_enabled') ? 'Yes' : 'No' }}<br>
@ -104,8 +102,7 @@ Maintenance enabled: {{ setting('app_maintenance_enabled') ? 'Yes' : 'No' }}<br>
Settings are accessible using `App\Core\Setting\SettingManager` which is a service. Settings are accessible using `App\Core\Setting\SettingManager` which is a service.
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Setting\SettingManager; use App\Core\Setting\SettingManager;
@ -132,7 +129,7 @@ You can also edit them from UI:
You can add options using this way: You can add options using this way:
``` ```php-inline
$event->setOption('view', 'large'); $event->setOption('view', 'large');
``` ```

View file

@ -9,8 +9,7 @@ A setting's value is stored in json so a value could be a string, a boolean, an
See the example below. See the example below.
``` ```php-inline title="src/EventSubscriber/NavigationSettingEventSubscriber.php"
// src/EventSubscriber/NavigationSettingEventSubscriber.php
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Core\Event\Setting\NavigationSettingEvent; use App\Core\Event\Setting\NavigationSettingEvent;
@ -73,8 +72,7 @@ Result:
Settings are accessible using `App\Core\Setting\NavigationSettingManager` which is a service. Settings are accessible using `App\Core\Setting\NavigationSettingManager` which is a service.
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Setting\NavigationSettingManager; use App\Core\Setting\NavigationSettingManager;
@ -95,7 +93,7 @@ class FooController
In a template, you can use the function `navigation_setting`: In a template, you can use the function `navigation_setting`:
``` ```twig
Tracker code: {{ navigation_setting(_navigation, 'nav_tracker_code') }}<br> Tracker code: {{ navigation_setting(_navigation, 'nav_tracker_code') }}<br>
Contact email: {{ navigation_setting('my_nav', 'nav_contact_email') }}<br> Contact email: {{ navigation_setting('my_nav', 'nav_contact_email') }}<br>
``` ```
@ -104,8 +102,7 @@ Contact email: {{ navigation_setting('my_nav', 'nav_contact_email') }}<br>
Settings are accessible using `App\Core\Setting\NavigationSettingManager` which is a service. Settings are accessible using `App\Core\Setting\NavigationSettingManager` which is a service.
``` ```php-inline title="src/Controller/FooController.php"
// src/Controller/FooController.php
namespace App\Controller; namespace App\Controller;
use App\Core\Setting\NavigationSettingManager; use App\Core\Setting\NavigationSettingManager;

View file

@ -2,8 +2,7 @@
Tasks are scripts executabled from UI. The creation of tasks is based on events. Tasks are scripts executabled from UI. The creation of tasks is based on events.
``` ```php-inline title="src/EventSubscriber/MyTaskEventSubscriber.php"
// src/EventSubscriber/MyTaskEventSubscriber.php
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Core\Event\Task\TaskInitEvent; use App\Core\Event\Task\TaskInitEvent;

View file

@ -26,7 +26,7 @@ By default, these variables are given to a CMS view:
You can access a page's blocks this way: You can access a page's blocks this way:
``` ```twig
{% set myBlock = _page.myBlock.value %} {% set myBlock = _page.myBlock.value %}
{{ myBlock }} {{ myBlock }}
@ -49,7 +49,7 @@ Murph has somes twig functions to manage URLs:
A node may have a disabled URL: A node may have a disabled URL:
``` ```twig
{% if not node.disableUrl %} {% if not node.disableUrl %}
{% set path = safe_node_path(node) %} {% set path = safe_node_path(node) %}
{% set url = safe_node_url(node) %} {% set url = safe_node_url(node) %}
@ -58,7 +58,7 @@ A node may have a disabled URL:
When the navigation has several domains, you can specify the domain: When the navigation has several domains, you can specify the domain:
``` ```twig
{% set path = safe_node_path(node, {_domain: _domain}) %} {% set path = safe_node_path(node, {_domain: _domain}) %}
{% set url = safe_node_url(node, {_domain: _domain}) %} {% set url = safe_node_url(node, {_domain: _domain}) %}
``` ```

View file

@ -24,7 +24,7 @@ The routing tab is very important. It allows you to define all parameters relate
To add a controller in the list, edit `config/packages/app.yaml`: To add a controller in the list, edit `config/packages/app.yaml`:
``` ```yaml
core: core:
site: site:
controllers: controllers:

View file

@ -3,8 +3,7 @@
A page is a doctrine entity that contains blocks and form builder. A page is a doctrine entity that contains blocks and form builder.
You can run `php bin/console make:page` and generate a new page in an interactive way. You can run `php bin/console make:page` and generate a new page in an interactive way.
``` ```php-inline title="src/Entity/Page/YourPage.php"
// src/Entity/Page/YourPage.php
namespace App\Entity\Page; namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block; use App\Core\Entity\Site\Page\Block;
@ -13,9 +12,7 @@ use App\Core\Form\Site\Page\TextBlockType;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
/** #[ORM\Entity]
* @ORM\Entity
*/
class YourPage extends Page class YourPage extends Page
{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -50,7 +47,7 @@ class YourPage extends Page
Then edit `config/packages/app.yaml` and add your page: Then edit `config/packages/app.yaml` and add your page:
``` ```yaml
core: core:
site: site:
pages: pages:
@ -85,7 +82,7 @@ core:
In the getter, you must specify the block: In the getter, you must specify the block:
``` ```php-inline
use App\Core\Entity\Site\Page\FileBlock; use App\Core\Entity\Site\Page\FileBlock;
public function getMyBlock(): Block public function getMyBlock(): Block
@ -116,7 +113,7 @@ public function getMyBlock(): Block
In the getter, you must specify the block: In the getter, you must specify the block:
``` ```php-inline
use App\Core\Entity\Site\Page\FileBlock; use App\Core\Entity\Site\Page\FileBlock;
public function getMyBlock(): Block public function getMyBlock(): Block
@ -129,7 +126,7 @@ public function getMyBlock(): Block
`App\Core\Form\Site\Page\CollectionBlockType` will a render a symfony `CollectionType ` with availabity to add and remove elements. `App\Core\Form\Site\Page\CollectionBlockType` will a render a symfony `CollectionType ` with availabity to add and remove elements.
``` ```php-inline
use App\Core\Entity\Site\Page\CollectionBlock; use App\Core\Entity\Site\Page\CollectionBlock;
public function getMyBlock(): Block public function getMyBlock(): Block
@ -142,8 +139,7 @@ public function getMyBlock(): Block
When a page is being edited, the options can be set as follows: When a page is being edited, the options can be set as follows:
``` ```php-inline title="src/EventSubscriber/PageEventSubscriber.php"
// src/EventSubscriber/PageEventSubscriber.php
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Core\Event\Page\PageEditEvent; use App\Core\Event\Page\PageEditEvent;

View file

@ -13,8 +13,8 @@ When the entity is created or updated, `createdAt` and `updatedAt` are automatic
### Usage ### Usage
``` ```php-inline title="src/Entity/FooEntity.php"
// App/Entity/FooEntity; namespace App/Entity;
use use App\Core\Entity\EntityInterface; use use App\Core\Entity\EntityInterface;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@ -24,10 +24,8 @@ use App\Core\Entity\EntityInterface;
use App\Repository\FooRepository; use App\Repository\FooRepository;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** #[ORM\Entity(repositoryClass: FooRepository::class)]
* @ORM\Entity(repositoryClass=FooRepository::class) #[ORM\HasLifecycleCallbacks]
* @ORM\HasLifecycleCallbacks
*/
class FooEntity implements EntityInterface class FooEntity implements EntityInterface
{ {
use Timestampable; use Timestampable;

View file

@ -8,7 +8,7 @@ Editor.js is fully integrated in Murph as form types.
## Classic form ## Classic form
``` ```php-inline
// src/Form/ExampleType.php // src/Form/ExampleType.php
namespace App\Form\ExampleType; namespace App\Form\ExampleType;
@ -34,7 +34,7 @@ class ExampleType extends AbstractType
Modified data should return stringified JSON array if empty: Modified data should return stringified JSON array if empty:
``` ```php-inline
public function getMyField(): string public function getMyField(): string
{ {
if (empty($this->myField)) { if (empty($this->myField)) {
@ -47,16 +47,14 @@ public function getMyField(): string
## Page form ## Page form
``` ```php-inline
// src/Entity/Page/YourPage.php // src/Entity/Page/YourPage.php
namespace App\Entity\Page; namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block; use App\Core\Entity\Site\Page\Block;
use App\Core\Form\Site\Page\EditorJsTextareaBlockType; use App\Core\Form\Site\Page\EditorJsTextareaBlockType;
/** #[@ORM\Entity]
* @ORM\Entity
*/
class YourPage extends Page class YourPage extends Page
{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -117,7 +115,7 @@ If you want to render specific blocks: `{{ value|editorjs_to_html(['paragraph',
Block have default templates stored in `vendor/murph/murph-core/src/core/Resources/views/editorjs`. Block have default templates stored in `vendor/murph/murph-core/src/core/Resources/views/editorjs`.
They can be simply overridden in `config/packages/app.yaml`: They can be simply overridden in `config/packages/app.yaml`:
``` ```yaml
core: core:
editor_js: editor_js:
blocks: blocks:

View file

@ -8,7 +8,7 @@ GrapesJS is fully integrated in Murph as form types.
## Classic form ## Classic form
``` ```php-inline
// src/Form/ExampleType.php // src/Form/ExampleType.php
namespace App\Form\ExampleType; namespace App\Form\ExampleType;
@ -34,16 +34,14 @@ class ExampleType extends AbstractType
## Page form ## Page form
``` ```php-inline
// src/Entity/Page/YourPage.php // src/Entity/Page/YourPage.php
namespace App\Entity\Page; namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block; use App\Core\Entity\Site\Page\Block;
use App\Core\Form\Site\Page\GrapesJsBlockType; use App\Core\Form\Site\Page\GrapesJsBlockType;
/** #[ORM\Entity]
* @ORM\Entity
*/
class YourPage extends Page class YourPage extends Page
{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -88,9 +86,7 @@ There are 3 modes:
To specify a mode, you must define the attribute `data-grapesjs`: To specify a mode, you must define the attribute `data-grapesjs`:
``` ```php-inline title="src/Form/ExampleType.php"
// src/Form/ExampleType.php
$builder->add( $builder->add(
'myField', 'myField',
GrapesJsType::class, GrapesJsType::class,
@ -103,8 +99,7 @@ $builder->add(
] ]
); );
// src/Entity/Page/YourPage.php ```php-inline title="src/Entity/Page/YourPage.php"
$builder->add( $builder->add(
'myBlock', 'myBlock',
GrapesJsBlockType::class, GrapesJsBlockType::class,

View file

@ -6,8 +6,7 @@ TinyMCE gives you total control over your rich text editing. It's fully integrat
## Classic form ## Classic form
``` ```php-inline title="src/Form/ExampleType.php"
// src/Form/ExampleType.php
namespace App\Form\ExampleType; namespace App\Form\ExampleType;
use App\Core\Form\Type\TinymceTextareaType; use App\Core\Form\Type\TinymceTextareaType;
@ -32,16 +31,13 @@ class ExampleType extends AbstractType
## Page form ## Page form
``` ```php-inline title="src/Entity/Page/YourPage.php"
// src/Entity/Page/YourPage.php
namespace App\Entity\Page; namespace App\Entity\Page;
use App\Core\Entity\Site\Page\Block; use App\Core\Entity\Site\Page\Block;
use App\Core\Form\Site\Page\TinymceTextareaBlockType; use App\Core\Form\Site\Page\TinymceTextareaBlockType;
/** #[ORM\Entity]
* @ORM\Entity
*/
class YourPage extends Page class YourPage extends Page
{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -85,9 +81,7 @@ There are 2 predefined modes:
To specify a mode, you must define the attribute `data-tinymce`: To specify a mode, you must define the attribute `data-tinymce`:
``` ```php-inline title="src/Form/ExampleType.php"
// src/Form/ExampleType.php
$builder->add( $builder->add(
'myField', 'myField',
TinymceTextareaType::class, TinymceTextareaType::class,
@ -99,9 +93,9 @@ $builder->add(
], ],
] ]
); );
```
// src/Entity/Page/YourPage.php ```php-inline title="src/Entity/Page/YourPage.php"
$builder->add( $builder->add(
'myBlock', 'myBlock',
TinymceTextareaBlockType::class, TinymceTextareaBlockType::class,
@ -119,9 +113,7 @@ $builder->add(
To custom the editor, see the example below: To custom the editor, see the example below:
``` ```javascript title="assets/js/admin.js"
// assets/js/admin.js
import '../../vendor/murph/murph-core/src/core/Resources/assets/js/admin.js' import '../../vendor/murph/murph-core/src/core/Resources/assets/js/admin.js'
window.tinymce.language = 'fr_FR' window.tinymce.language = 'fr_FR'
@ -142,9 +134,9 @@ window.tinymce.murph.modes.myCustomMode = {
], ],
content_style: '...' content_style: '...'
} }
```
// src/Form/ExampleType.php ```php-inline title="src/Form/ExampleType.php"
$builder->add( $builder->add(
'myField', 'myField',
TinymceTextareaType::class, TinymceTextareaType::class,
@ -156,9 +148,9 @@ $builder->add(
], ],
] ]
); );
```
// src/Entity/Page/YourPage.php ```php-inline title="src/Entity/Page/YourPage.php"
$builder->add( $builder->add(
'myBlock', 'myBlock',
TinymceTextareaBlockType::class, TinymceTextareaBlockType::class,

View file

@ -3,7 +3,7 @@
`App\Core\File\FileAttribute::handleFile` transforms a file path to an instance of `Symfony\Component\HttpFoundation\File\File`. You can specify another class if needed. `App\Core\File\FileAttribute::handleFile` transforms a file path to an instance of `Symfony\Component\HttpFoundation\File\File`. You can specify another class if needed.
If the path is `null` or if the file does not exist, it returns `null`. If the path is `null` or if the file does not exist, it returns `null`.
``` ```php-inline
use App\Core\File\FileAttribute; use App\Core\File\FileAttribute;
use App\Foo\Bar; use App\Foo\Bar;

View file

@ -2,7 +2,7 @@
`App\Core\Form\FileUploadHandler` is a service and helps you to upload a file. See example below. `App\Core\Form\FileUploadHandler` is a service and helps you to upload a file. See example below.
``` ```php-inline
use App\Core\Form\FileUploadHandler; use App\Core\Form\FileUploadHandler;
use App\Entity\Foo; use App\Entity\Foo;
use App\Form\FooType; use App\Form\FooType;

View file

@ -21,7 +21,7 @@ Useful methods:
Exemple: Exemple:
``` ```php-inline
use App\Core\Notification\MailNotifier; use App\Core\Notification\MailNotifier;
use App\Repository\UserRepositoryQuery; use App\Repository\UserRepositoryQuery;

View file

@ -1,47 +1,77 @@
site_name: Documentation of Murph site_name: Documentation of Murph
# extra_css:
# - /_static/css/extra.css
plugins:
- search
theme: theme:
name: readthedocs name: material
extra_css: logo: /_static/img/logo.svg
- /_static/css/extra.css favicon: /_static/img/logo.svg
features:
- content.code.copy
palette:
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
extend_pygments_lang:
- name: php-inline
lang: php
options:
startinline: true
- pymdownx.tabbed:
alternate_style: true
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.highlight
- pymdownx.inlinehilite
nav: nav:
- Overview: index.md - Overview: index.md
- 'Sources codes': sources.md - 'Sources codes': sources.md
- Installation: install.md - Installation: install.md
- 'Tree manager': - 'Tree manager':
- Overview: tree/index.md - Overview: tree/index.md
- Navigation: tree/navigation.md - Navigation: tree/navigation.md
- Menu: tree/menu.md - Menu: tree/menu.md
- Node: tree/node.md - Node: tree/node.md
- Page: tree/page.md - Page: tree/page.md
- Controller: - Controller: controller.md
- Controller: controller.md - Template: template.md
- Template: - Entities:
- Template: template.md - 'Entity Manager': entities/em.md
- Entities: - 'Repository Query': entities/query.md
- 'Entity Manager': entities/em.md - Factory: entities/factory.md
- 'Repository Query': entities/query.md - CRUD:
- Factory: entities/factory.md - Overview: crud/index.md
- CRUD: - Generator: crud/generator.md
- Overview: crud/index.md - Configuration: crud/configuration.md
- Generator: crud/generator.md - Settings:
- Configuration: crud/configuration.md - 'Global settings': settings/global.md
- Settings: - 'Navigation settings': settings/navigation.md
- 'Global settings': settings/global.md - Editors:
- 'Navigation settings': settings/navigation.md - TinyMCE: utils/editors/tinymce.md
- Editors: - GrapesJS: utils/editors/grapesjs.md
- TinyMCE: utils/editors/tinymce.md - Editor.js: utils/editors/editorjs.md
- GrapesJS: utils/editors/grapesjs.md - Utils:
- Editor.js: utils/editors/editorjs.md - Cache Manager: utils/cache.md
- Utils: - Doctrine: utils/doctrine.md
- Cache Manager: utils/cache.md - File upload handler: utils/file_handler.md
- Doctrine: utils/doctrine.md - File attribute: utils/file_attribute.md
- File upload handler: utils/file_handler.md - Mail notifier: utils/mail.md
- File attribute: utils/file_attribute.md - Slug: utils/slug.md
- Mail notifier: utils/mail.md - "A/B Testing": abtesting.md
- Slug: utils/slug.md - Users: users.md
- "A/B Testing": - Tasks: tasks.md
- 'A/B Testing': abtesting.md
- Users:
- Users: users.md
- Tasks:
- Tasks: tasks.md