I’m currently creating my own CMS and I have a hard question (I think it is) and I can’t found anything on Google…
I’m trying to make a edit_settings.php with AJAX and PHP, to include my Zend_Config_Ini into it ’cause I’m using this for my config.ini parsing and writing.
There’s is the base of the PHP code (my array isn’t there, normal):
<?php
$config = new Zend_Config_Ini('config.ini',null,array('skipExtends' => true, 'allowModifications' => true));
// Write the config file
$writer = new Zend_Config_Writer_Ini(array('config' => $config,'filename' => 'config.ini'));
$writer->write();
?>
Exemple: I click on “Edit” and the red-bordered zone become a input field and I can edit it without changing page and I just need to click “Save” after to save the config in the config.ini file.

I know that this needs AJAX, PHP and the Zend_Config_Ini but I don’t know how to link them together…
The question: HOW I CAN DO THIS?
I wouldn’t go with the whole page refresh thing. It adds additional logic to the controller. Logic which could be easily be in specialized ajax controllers. And jQuery’s AJAX is cool. And AJAX is perfect for edit-in-place stuff.
I’ll make the following assumptions:
you use jQuery
you know that a valid JSON string becomes a JS object in jQuery
you have an AjaxController with a “settingsEditAction”
you know that this is my take on your problem, not imposing any style of
thinking or even of coding; this is how I would do it, so it’s bad
or good.
you know I’ve written this in np++, off the top of my head, so you won’t freak out on missing colons or the like
In AjaxController:
The jQuery part:
LE:
Actually, I’ve missed the part in which you click edit, and the
pturns into aninput.Click
edit: 1stphas “save” as text, and the siblingpbecomes an input.Click
saveparagraph: send post; if success, set the original markup (2<p>‘s).