0

契約書またはビジネス フォームのテキストを含む大きなテキスト フィールドを含むクラスがあります。これまでのコードは次のとおりです。

public function saveAction()
{
    if (isset ($_POST['Save']) && $this->isPostSafe()) {
        $form = Form::getPostObject();
        $form->text = addslashes($form->text);
        var_dump($form);
        $form->save($this->_databaseConnection);
    }
    $this->redirect('/forms');
}

public function __construct()
{
    $company_info = Config::get('Company');
    foreach ($company_info as $setting => $value) {
        $this->variables[$setting] = $value;
    }
    $this->variables = serialize($this->variables);
}

public function set($name, $value)
{
    $values = unserialize($this->variables);
    $values[$name] = $value;
    $this->variables = serialize($this->variables);
}

public function render()
{
    var_dump($this->variables);
    $values = unserialize($this->variables);

    foreach ( $values as $key => $value) {
        $from = "[@$key]";
        $this->text = str_replace($from, $value, $this->text);
    }
    return $template;
}

問題は、var_dump によってシリアル化されていない文字列が返されることです。base64_encode を試しましたが、問題は解決しませんでした。

4

2 に答える 2