Hi.
I've successfully generated news scaffold in my admin panel. I've created input called created_by, where I've to set name of editor. I would like to have default value, took from $_SESSION array. In add.tpl it looks like this:
echo $controller->renderPartial('form')
So I'm unable to edit this part of view manually. How to pass default value to form input ?
'form' is the _form.tpl in your view folder. I believe you have to set the $editor using $this->controller->editor = $_SESSION['editor']; then you can access it as $controller->editor;
.. and in edit.tpl you will find the same thing, because they both include the same file, a partial. Look for the file named '_form.tpl' in the same directory.
How to pass default value to form input ?
Just set it in the controller, in the add (or edit) method. Like:
$this->News->created_by = $_SESSION['user_name'];
Riffed, That's a coincidence! We both posted a reply in a 20 second time window.
1 to 4 of 4