public function getLayout()
{
if (!array_key_exists('layoutClass', $this->options)) {
$this->options['layoutClass'] = 'Phalcon\\Paginator\\Pager\\Layout';
}
if (!array_key_exists('urlMask', $this->options)) {
throw new \RuntimeException('You must provide option "urlMask"');
}
$range = null;
$rangeClass = $this->getRangeClass();
$rangeLength = $this->getRangeLength();
if (!class_exists($rangeClass)) {
throw new \RuntimeException(sprintf('Unable to find range class "%s"', $rangeClass));
}
if (!class_exists($this->options['layoutClass'])) {
throw new \RuntimeException(sprintf('Unable to find layout "%s"', $this->options['layoutClass']));
}
return new $this->options['layoutClass']($this, new $rangeClass($this, $rangeLength), $this->options['urlMask']);
}