Expand controller actions to Mux object.

@return Mux
434377
public function expand(array $options = array(), $dynamic = false)
    {
        $this->mux = $mux = new Mux();
        $routes = ControllerRouteBuilder::build($this);
        foreach ($routes as $route) {
            if ($dynamic) {
                $mux->add($route[0], array($this, $route[1]), array_merge($options, $route[2]));
            } else {
                $mux->add($route[0], array(get_class($this), $route[1]), array_merge($options, $route[2]));
            }
        }
        $mux->sort();
        return $mux;
    }
179632
public function mapAction() {
		$action = $this->_getRequest()->params['action'];
		if ($this->getConfig('directMapping') === true) {
			$this->_directMapping($action);
		}

		return $this->_mapAction($action);
	}
196894
public function getActionMapper()
    {
        if (null === $this->actionMapper) {
            $this->actionMapper = $this->serviceLocator->get('playgroundflow_action_mapper');
        }

        return $this->actionMapper;
    }
131089
private function generateBasicController()
    {
        $controllerClass = $this->applicationDir.DS.'Controllers'.DS.$this->controller.'Controller'.EXT;

        if (file_exists($controllerClass)) {
            throw new \Exception("$controllerClass already exists!!");
        }

        /*write operation ->*/
        $filePointer = fopen($controllerClass, 'w') or die('Unable to generate controller');

        $controllerContent = $this->getControllerTemplate();
        $content = $this->getIndexStub();
        $content = $this->replaceTemplate('{%methods%}', $content, $controllerContent);

        return $this->writeContentToClass($filePointer, $content);
    }
1190646
public function getAction()
	{
		$action = strtolower($this->getParam(self::ACTION_PARAM));
		if ($action === '' or ! preg_match('/^[a-z0-9_-]+$/', $action)) {
			return Controller::DEFAULT_ACTION;
		}

		return $action;
	}
911006
public function indexAction()
    {
        $optionsProvider = $this->getOptionsProvider();
        if ($this->getRequest()->isPost()) {
            $event = $this->request->getPost('suboperation');
            if (! empty($event)) {
                $events = $this->getEventManager();
                $params = $this->request->getPost();
                $result = $events->trigger($event, $this, $params);
                if ($result->last() instanceof Response) {
                    return $result->last();
                }
            }
        }
        $lists = $this->getContentListProvider();

        $view = new ViewModel([
            'optionsProvider' => $optionsProvider,
            'contentListsProvider' => $lists
        ]);

        $flashMessenger = $this->flashMessenger();
        if ($flashMessenger->hasMessages()) {
            $view->messages = $flashMessenger->getMessages();
        }

        return $view;
    }
952395
public function rawObjectActions()
    {
        if ($this->objectActions === null) {
            $parsed = $this->parsedObjectActions;

            $collectionConfig = $this->collectionConfig();
            if (isset($collectionConfig['object_actions'])) {
                $actions = $collectionConfig['object_actions'];
            } else {
                $actions = [];
            }

            $this->setObjectActions($actions);

            $this->parsedObjectActions = $parsed;
        }

        if ($this->parsedObjectActions === false) {
            $this->parsedObjectActions = true;
            $this->objectActions = $this->createObjectActions($this->objectActions);
        }

        return $this->objectActions;
    }
889066
public function copyAction()
    {
        $trackId    = $this->_getIdParam();
        $engine     = $this->getTrackEngine();
        $newTrackId = $engine->copyTrack($trackId);

        $this->_reroute(array('action' => 'edit', \MUtil_Model::REQUEST_ID => $newTrackId));
    }
1256966
def expand_actions(self, actions):
        """"""
        results = list()

        for action in actions:
            if action in self.aliased_actions:
                results.append(action)
                for item in self.expand_actions(self.aliased_actions[action]):
                    results.append(item)
            else:
                results.append(action)

        return results
878465
public function buildXing()
    {
        $xingProvider = new XingProvider(array(
            'shape' => $this->configResolver->getParameter('xing.shape', 'ez_share_buttons'),
            'counter' => $this->configResolver->getParameter('xing.counter', 'ez_share_buttons'),
            'language' => $this->configResolver->getParameter('xing.language', 'ez_share_buttons'),
        ));

        return $xingProvider;
    }
1295390
private function replaceDummyContent()
    {
        // Replace DummyTheme string in Controllers
        $this->replaceDummy($this->destinationDir . '/controllers');

        // Replace DummyTheme string in views
        $this->replaceDummy($this->destinationDir . '/views');

        // Replace DummyTheme string in config
        $this->replaceDummyInFile($this->destinationDir.'/config.json');

        return $this;
    }
1369429
public function build()
    {
        $prefix = $this->options['prefix'];
        foreach ($this->resources as $resId => $controller) {
            $resourceMux = $controller->expand();
            $path = $prefix . '/' . $resId;
            $this->mux->mount($path, $resourceMux);
        }
        return $this->mux;
    }
465727
public function getExtension()
	{
		if (!isset($this->extension))
		{
			$bits = explode('.', $this->getName());
			if (count($bits) > 1)
			{
				$this->extension = end($bits);
			}
			else
			{
				$this->extension = '';
			}
		}

		return $this->extension;
	}
1156316
public function proceed()
	{
		if( $this->getType() == 1 )
		{
			$output = $this->controls[0] ? $this->inputs[1] : $this->inputs[0];
		}
		else if( $this->getType() == 2 )
		{
			$mux = new ADT_Multiplexer();
			$mux->setControls( $this->controls[0] );
			$mux->setInputs( $this->inputs[0], $this->inputs[1] );
			$input0 = $mux->proceed();
			$mux->setInputs( $this->inputs[2], $this->inputs[3] );
			$input1 = $mux->proceed();
			$mux->setControls( $this->controls[1] );
			$mux->setInputs( $input0, $input1 );
			$output = $mux->proceed();
		}
		else if( $this->getType() == 4)
		{
			$mux2 = new ADT_Multiplexer( 2 );
			$mux2->setControls( $this->controls[0], $this->controls[1] );
			$mux2->setInputs( $this->inputs[0], $this->inputs[1], $this->inputs[2], $this->inputs[3] );
			$input0 = $mux2->proceed();
			$mux2->setInputs( $this->inputs[4], $this->inputs[5], $this->inputs[6], $this->inputs[7] );
			$input1 = $mux2->proceed();
			$mux2->setInputs( $this->inputs[8], $this->inputs[9], $this->inputs[10], $this->inputs[11] );
			$input2 = $mux2->proceed();
			$mux2->setInputs( $this->inputs[12], $this->inputs[13], $this->inputs[14], $this->inputs[15] );
			$input3 = $mux2->proceed();
			$mux2->setControls( $this->controls[2], $this->controls[3] );
			$mux2->setInputs( $input0, $input1, $input2, $input3 );
			$output = $mux2->proceed();
		}
		return $output;
	}
1148366
public function indexAction()
    {
        $entry = $this->getGameService()->checkExistingEntry($this->game, $this->user);
        $games = $this->getGameService()->getMissionGames($this->game, $this->user);

        $viewModel = $this->buildView($this->game);
        $viewModel->setVariables(
            array(
            'user'          => $this->user,
            'games'         => $games,
            'entry'         => $entry,
            'flashMessages' => $this->flashMessenger()->getMessages(),
            )
        );

        return $viewModel;
    }
178408
public function getActionMap()
    {
        $plugins = $this->getLoadedPluginPaths();

        $actionMap = [];
        foreach ($plugins as $plugin => $path) {
            $controllers = $this->getControllersForPlugin($plugin, $path);
            foreach ($controllers as $controller) {
                $actions = $this->introspectController($controller['path']);
                if (empty($actions)) {
                    continue;
                }
                foreach ($actions as $action) {
                    $path = "{$plugin}.{$controller['name']}.{$action}";
                    if (in_array($path, $this->_guestActions)) {
                        continue;
                    }
                    $actionMap[$path] = [
                        'plugin' => $plugin,
                        'controller' => $controller['name'],
                        'action' => $action
                    ];
                }
            }
        }

        $appControllers = $this->getControllersForApp();
        foreach ($appControllers as $controller) {
            $actions = $this->introspectController($controller['path']);

            if (empty($actions)) {
                continue;
            }
            foreach ($actions as $action) {
                if (strpos($controller['path'], ROOT . DS . 'src' . DS . 'Controller') === false) {
                    $path = "App.{$controller['name']}.{$action}";
                    if (in_array($path, $this->_guestActions)) {
                        continue;
                    }
                    $actionMap[$path] = [
                        'plugin' => 'App',
                        'controller' => $controller['name'],
                        'action' => $action
                    ];
                } else {
                    $namespaceParts = explode(DS, substr($controller['path'], strlen(ROOT . DS . 'src' . DS . 'Controller') + 1));
                    array_pop($namespaceParts);
                    $namespace = join('/', $namespaceParts);
                    if (!empty($namespace)) {
                        $path = "App.{$namespace}/{$controller['name']}.{$action}";
                    } else {
                        $path = "App.{$controller['name']}.{$action}";
                    }
                    if (in_array($path, $this->_guestActions)) {
                        continue;
                    }
                    $actionMap[$path] = [
                        'plugin' => 'App',
                        'controller' => !empty($namespace) ? $namespace . '/' . $controller['name'] : $controller['name'],
                        'action' => $action
                    ];
                }
            }
        }

        return $actionMap;
    }
1263028
public function getActualExtension()
    {
        $route = Route::getCurrentRoute();

        if ($route instanceof \Illuminate\Routing\Route) {
            $action = $route->getActionName();

            if ($action === 'Closure') {
                return false;
            }

            preg_match("/.+?(?=\\\)(.*)\Http/", $action, $matches);
            return empty($matches) ? false : strtolower(trim($matches[1], '\\'));
        }

        return false;
    }