original_string: public function onExpandMarkupToken()
      {
          if (!$alias = post('tokenName')) {
              throw new ApplicationException(trans('cms::lang.component.no_records'));
          }
  
          // Can only expand components at this stage
          if ((!$type = post('tokenType')) && $type !== 'component') {
              return;
          }
  
          if (!($names = (array) post('component_names')) || !($aliases = (array) post('component_aliases'))) {
              throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias]));
          }
  
          if (($index = array_get(array_flip($aliases), $alias, false)) === false) {
              throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias]));
          }
  
          if (!$componentName = array_get($names, $index)) {
              throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias]));
          }
  
          $manager = ComponentManager::instance();
          $componentObj = $manager->makeComponent($componentName);
          $partial = ComponentPartial::load($componentObj, 'default');
          $content = $partial->getContent();
          $content = str_replace('__SELF__', $alias, $content);
  
          return $content;
      }
code: public function onExpandMarkupToken()
      {
          if (!$alias = post('tokenName')) {
              throw new ApplicationException(trans('cms::lang.component.no_records'));
          }
  
          // Can only expand components at this stage
          if ((!$type = post('tokenType')) && $type !== 'component') {
              return;
          }
  
          if (!($names = (array) post('component_names')) || !($aliases = (array) post('component_aliases'))) {
              throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias]));
          }
  
          if (($index = array_get(array_flip($aliases), $alias, false)) === false) {
              throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias]));
          }
  
          if (!$componentName = array_get($names, $index)) {
              throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias]));
          }
  
          $manager = ComponentManager::instance();
          $componentObj = $manager->makeComponent($componentName);
          $partial = ComponentPartial::load($componentObj, 'default');
          $content = $partial->getContent();
          $content = str_replace('__SELF__', $alias, $content);
  
          return $content;
      }
code_tokens: public function onExpandMarkupToken ( ) { if ( ! $ alias = post ( 'tokenName' ) ) { throw new ApplicationException ( trans ( 'cms::lang.component.no_records' ) ) ; } // Can only expand components at this stage if ( ( ! $ type = post ( 'tokenType' ) ) && $ type !== 'component' ) { return ; } if ( ! ( $ names = ( array ) post ( 'component_names' ) ) || ! ( $ aliases = ( array ) post ( 'component_aliases' ) ) ) { throw new ApplicationException ( trans ( 'cms::lang.component.not_found' , [ 'name' => $ alias ] ) ) ; } if ( ( $ index = array_get ( array_flip ( $ aliases ) , $ alias , false ) ) === false ) { throw new ApplicationException ( trans ( 'cms::lang.component.not_found' , [ 'name' => $ alias ] ) ) ; } if ( ! $ componentName = array_get ( $ names , $ index ) ) { throw new ApplicationException ( trans ( 'cms::lang.component.not_found' , [ 'name' => $ alias ] ) ) ; } $ manager = ComponentManager :: instance ( ) ; $ componentObj = $ manager -> makeComponent ( $ componentName ) ; $ partial = ComponentPartial :: load ( $ componentObj , 'default' ) ; $ content = $ partial -> getContent ( ) ; $ content = str_replace ( '__SELF__' , $ alias , $ content ) ; return $ content ; }
docstring: Remembers an open or closed state for a supplied token, for example, component folders.
  @return array
docstring_tokens: Remembers an open or closed state for a supplied token for example component folders .