| @@ 100-119 (lines=20) @@ | ||
| 97 | * |
|
| 98 | * @return string |
|
| 99 | */ |
|
| 100 | protected function findModel($name) |
|
| 101 | { |
|
| 102 | $section = strstr($this->name, '/', true); |
|
| 103 | if ($section && file_exists($model = sprintf('%s/models/%s.md', $this->getPath(), $section))) { |
|
| 104 | return file_get_contents($model); |
|
| 105 | } |
|
| 106 | if (file_exists($model = sprintf('%s/models/default.md', $this->getPath()))) { |
|
| 107 | return file_get_contents($model); |
|
| 108 | } |
|
| 109 | ||
| 110 | return <<<'EOT' |
|
| 111 | --- |
|
| 112 | title: '%title%' |
|
| 113 | date: '%date%' |
|
| 114 | draft: true |
|
| 115 | --- |
|
| 116 | ||
| 117 | _[Your content here]_ |
|
| 118 | EOT; |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * Editor is configured? |
|
| @@ 86-105 (lines=20) @@ | ||
| 83 | * |
|
| 84 | * @return string |
|
| 85 | */ |
|
| 86 | protected function findModel($name) |
|
| 87 | { |
|
| 88 | $section = strstr($this->name, '/', true); |
|
| 89 | if ($section && file_exists($model = sprintf('%s/models/%s.md', $this->getPath(), $section))) { |
|
| 90 | return file_get_contents($model); |
|
| 91 | } |
|
| 92 | if (file_exists($model = sprintf('%s/models/default.md', $this->getPath()))) { |
|
| 93 | return file_get_contents($model); |
|
| 94 | } |
|
| 95 | ||
| 96 | return <<<'EOT' |
|
| 97 | --- |
|
| 98 | title: '%title%' |
|
| 99 | date: '%date%' |
|
| 100 | draft: true |
|
| 101 | --- |
|
| 102 | ||
| 103 | _[Your content here]_ |
|
| 104 | EOT; |
|
| 105 | } |
|
| 106 | ||
| 107 | /** |
|
| 108 | * Editor is configured? |
|