1 <?php
2
3 /*
4 * This file is part of the Icybee package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Icybee\Modules\Editor;
13
14 /**
15 * "Patron" editor.
16 */
17 class PatronEditor implements Editor
18 {
19 /**
20 * Returns content as is.
21 *
22 * @see Icybee\Modules\Editor.Editor::serialize()
23 */
24 public function serialize($content)
25 {
26 return $content;
27 }
28
29 /**
30 * Returns serialized content as is.
31 *
32 * @see Icybee\Modules\Editor.Editor::unserialize()
33 */
34 public function unserialize($serialized_content)
35 {
36 return $serialized_content;
37 }
38
39 /**
40 * @return RawEditorElement
41 *
42 * @see Icybee\Modules\Editor.Editor::from()
43 */
44 public function from(array $attributes)
45 {
46 return new PatronEditorElement($attributes);
47 }
48
49 /**
50 * Returns content as is.
51 *
52 * @see Icybee\Modules\Editor.Editor::render()
53 */
54 public function render($content)
55 {
56 $patron = new \Patron\Engine();
57
58 return $patron($content);
59 }
60 }