Exemplo n.º 1
0
 /**
  * Поиск и создание прокси-объекта для вызова методов типа документа.
  *
  * @param string $url      URL.
  * @param string $urlModel Модель, которая обрабатывает URL и хранит данные о них.
  *
  * @return DoctypeResolver прокси-объект для вызова типа документа.
  */
 public function find($url, $urlModel)
 {
     $address = $this->findUrl($url, $urlModel);
     return DoctypeResolver::createDoctype($address->doctype, [$urlModel => function () use($address) {
         return $address;
     }]);
 }
Exemplo n.º 2
0
Arquivo: Main.php Projeto: deadem/djem
 public function getDoctype($id)
 {
     $doctype = null;
     $leaf = $this->findLeaf($id);
     if ($leaf) {
         $doctype = $leaf['_doctype'];
     }
     if (!class_exists($doctype)) {
         throw new BadMethodCallException('Can\'t create class ' . $doctype);
     }
     return DoctypeResolver::createDoctype($doctype);
 }
Exemplo n.º 3
0
 private function doctype()
 {
     return DoctypeResolver::createDoctype($this->request->input('_doctype'));
 }