Add config() Go to Definition support to VS Code extension
Always include params in window.rsxapp to reduce state variations Add request params to window.rsxapp global Enhance module creation commands with clear nomenclature guidance Add module/submodule/feature nomenclature clarification to docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -267,6 +267,10 @@ abstract class Rsx_Bundle_Abstract
|
||||
$rsxapp_data['is_auth'] = Session::is_logged_in();
|
||||
$rsxapp_data['ajax_disable_batching'] = config('rsx.development.ajax_disable_batching', false);
|
||||
|
||||
// Add current params (always set to reduce state variations)
|
||||
$current_params = \App\RSpade\Core\Rsx::get_current_params();
|
||||
$rsxapp_data['params'] = $current_params ?? [];
|
||||
|
||||
// Add user, site, and csrf data from session
|
||||
$rsxapp_data['user'] = Session::get_user();
|
||||
$rsxapp_data['site'] = Session::get_site();
|
||||
|
||||
@@ -246,7 +246,7 @@ class Dispatcher
|
||||
Debugger::console_debug('DISPATCH', 'Matched route to ' . $handler_class . '::' . $handler_method . ' params: ' . json_encode($params));
|
||||
|
||||
// Set current controller and action in Rsx for tracking
|
||||
\App\RSpade\Core\Rsx::_set_current_controller_action($handler_class, $handler_method);
|
||||
\App\RSpade\Core\Rsx::_set_current_controller_action($handler_class, $handler_method, $params);
|
||||
|
||||
// Load and validate handler class
|
||||
static::__load_handler_class($handler_class);
|
||||
@@ -574,7 +574,7 @@ class Dispatcher
|
||||
}
|
||||
|
||||
// Set current controller and action for tracking
|
||||
Rsx::_set_current_controller_action($class_name, $method_name);
|
||||
Rsx::_set_current_controller_action($class_name, $method_name, $params);
|
||||
|
||||
// Check if this is a controller (all methods are static)
|
||||
if (static::__is_controller($class_name)) {
|
||||
|
||||
@@ -35,13 +35,20 @@ class Rsx
|
||||
*/
|
||||
protected static $current_action = null;
|
||||
|
||||
/**
|
||||
* Current request params
|
||||
* @var array|null
|
||||
*/
|
||||
protected static $current_params = null;
|
||||
|
||||
/**
|
||||
* Set the current controller and action being executed
|
||||
*
|
||||
* @param string $controller_class The controller class name
|
||||
* @param string $action_method The action method name
|
||||
* @param array $params Optional request params to store
|
||||
*/
|
||||
public static function _set_current_controller_action($controller_class, $action_method)
|
||||
public static function _set_current_controller_action($controller_class, $action_method, array $params = [])
|
||||
{
|
||||
// Extract just the class name without namespace
|
||||
$parts = explode('\\', $controller_class);
|
||||
@@ -49,6 +56,7 @@ class Rsx
|
||||
|
||||
static::$current_controller = $class_name;
|
||||
static::$current_action = $action_method;
|
||||
static::$current_params = $params;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,6 +79,16 @@ class Rsx
|
||||
return static::$current_action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current request params
|
||||
*
|
||||
* @return array|null The current request params or null if not set
|
||||
*/
|
||||
public static function get_current_params()
|
||||
{
|
||||
return static::$current_params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the current controller and action tracking
|
||||
*/
|
||||
@@ -78,6 +96,7 @@ class Rsx
|
||||
{
|
||||
static::$current_controller = null;
|
||||
static::$current_action = null;
|
||||
static::$current_params = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user