0

我想将包含电子邮件作为参数的大型数组传递给 cakephp 外壳。我不确定使用哪种方法-

  1. 使用数组模型来存储数据并在 shell 中读取模型。

  2. 在调用 shell 时将数组值作为参数传递。

  3. 将数组存储在缓存中并从 shell 访问。

我正在使用 shell_exec 执行 shell。

如果您指出使用哪种方法或者是否有更好的编码方法会很好?

4

1 回答 1

0

尝试使用此代码从控制器的操作中获取您的数组:

App::import('Core', array('View', 'Controller', 'Model', 'Router'));
App::import('Controller', 'YourController');
$YourController =& new YourControllerController();
$YourController->constructClasses();
$YourController->layout = null; 
$this->out(call_user_func(array($NewsletterController, 'yourAction')));
于 2015-02-13T01:05:39.893 回答