hi, i think that you should not unset fields in your form but specify
what fields you need in this form with method useFields()
public function configure()
{
$this->useFields(array('filename', 'caption'));
.....
}
On 14 дек, 10:13, sepelloo <[email protected]> wrote:
> Hi all.
> I'm developing a simple forum myself.
> I have the forum, topic and post module.
> I generated them by symfony.
> Now in topic I want to hide some filed such as
> created_at,is_solved,forum_id and user_id field.
> I change Configure function using unset:
> E:\dev\sfproject\myproject\apps\frontend\lib\form\doctrine
> public function configure()
> {
> unset(
> $this['created_at'], $this['updated_at'],
> $this['is_solved'], $this['is_closed'],
> $this['user_id'],$this['forum_id']
> );
>
> For set them i used new ation:
> E:\dev\sfproject\myproject\apps\frontend\modules\topic\actions
> public function executeNew(sfWebRequest $request)
> {
> $topic=new Topic();
> $topic->setForumId($this->getUser()->getAttribute('forumid'));
> $topic->setUserId($this->getUser()->getGuardUser()->getId());
> $topic->setIsClosed(false);
> $topic->setIsSolved(false);
>
> $this->form = new TopicForm($topic);
>
> }
>
> But beacus i unset them these fileds not saved in my tables?
> Where can I override save function?
> Totaly How override frontend action?
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.