| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function slugifyString() |
||
| 19 | { |
||
| 20 | //only admins can update the slug |
||
| 21 | $this->onlyAdmin(); |
||
| 22 | if (!$this->container->getRequest()->isPost()) { |
||
| 23 | throw new JsonException('Call is not post'); |
||
| 24 | } |
||
| 25 | $slug = $this->request->getData("slugText-update"); |
||
| 26 | $result = array(); |
||
| 27 | $slugify = new Slugify(); |
||
| 28 | $result['slug'] = $slugify->slugify($slug); |
||
| 29 | echo json_encode($result); |
||
| 30 | } |
||
| 31 | } |