I have a file like below i would like for my script to be able to write a new array into the area "---- new data ----" every time i run my generator. How would i best be able to go about this?
The data would be something like 'indices' => array(),
<?php
// Define your Custom Roots and default Root here
class Routes
{
public static $default = array(
// In the following example we set indices to be the default for /. 'root' => 'indices'
'root' => ''
);
public static $rewrites = array(
// In the following example we rewrite indices to index. array('index', 'indices')
);
public static $resources = array (
// Every controller you want the user to access must be mapped. 'indices' => array()
// If a controller belongs to another controller: 'indices' => array('child')
---- new data ----
);
}
2 cases were data would need to be added.
1st is empty
public static $resources = array (
// Every controller you want the user to access must be mapped. 'indices' => array()
// If a controller belongs to another controller: 'indices' => array('child')
);
2nd already has resources
public static $resources = array (
// Every controller you want the user to access must be mapped. 'indices' => array()
// If a controller belongs to another controller: 'indices' => array('child')
'indices' => array(),
'blogs' => array('comments')
);
In both cases i would want to add to the file.. say 'forums' => array('topics'), as its all i can think of.