code: protected function findSlots($templateName, $templateContents)
      {
          // find repeated slots
          preg_match_all(
              '/\{#[\s]?repeat:[\s]?(site|language)[^\}]+[^\{]+\{\{[\s]+?slots.([^|]+)?/is',
              $templateContents,
              $matches,
              PREG_SET_ORDER
          );
          $slots = array();
          $rawSlots = array();
          foreach ($matches as $slot) {
              $repeat = $slot[1];
              $slotName = $slot[2];
              $slots[$repeat][] = $slotName;
              $rawSlots[] = $slotName;
          }
  
          // find all slots
          preg_match_all('/\{\{[\s]+?slots.([^|]+)?/is', $templateContents, $matches);
          $pageSlots = array_diff($matches[1], $rawSlots);
          //$this->templateSlots[$templateName] = $pageSlots;
          if (empty($pageSlots)) {
              return $slots;
          }
  
          $slots["page"] = $pageSlots;
  
          return $slots;
      }
docs: Parses the given template to find slots
  @param string $templateName
  @param string $templateContents
  
  @return array