1616 * @throws \Exception
1717 */
1818
19- function Boot ( string $ ConfigPath ) : Application
19+ function boot ( string $ ConfigPath ) : Application
2020{
2121 /** @var Neuron\Data\Setting\Source\ISettingSource $Settings */
2222
@@ -42,7 +42,7 @@ function Boot( string $ConfigPath ) : Application
4242 *
4343 * @param Application $App
4444 */
45- function Dispatch ( Application $ App ) : void
45+ function dispatch ( Application $ App ) : void
4646{
4747 $ Route = Get::filterScalar ( 'route ' ) ?? "" ;
4848
@@ -69,19 +69,20 @@ function Dispatch( Application $App ) : void
6969 * @param Application $App
7070 * @return int Number of entries removed
7171 */
72- function ClearExpiredCache ( Application $ App ) : int
72+ function clearExpiredCache ( Application $ App ) : int
7373{
7474 return $ App ->clearExpiredCache ();
7575}
7676
7777/**
7878 * Render a partial view from the shared directory.
7979 * This function looks for a file named _{name}.php in the shared views directory.
80- * @param string $name
80+ * @param string $name The name of the partial (without underscore prefix or .php extension)
81+ * @param array $Data Optional data array to pass to the partial as variables
8182 * @return void
8283 * @throws NotFound
8384 */
84- function Partial ( string $ name ) : void
85+ function partial ( string $ name, array $ Data = [] ) : void
8586{
8687 $ Path = Registry::getInstance ()
8788 ->get ( "Views.Path " );
@@ -99,6 +100,9 @@ function Partial( string $name ) : void
99100 throw new NotFound ( "Partial not found: $ View " );
100101 }
101102
103+ // Extract data array as variables in the partial's scope
104+ extract ( $ Data );
105+
102106 ob_start ();
103107 require ( $ View );
104108 $ Content = ob_get_contents ();
0 commit comments