Add New Row Form page.

@return \Magento\Backend\Model\View\Result\Page
356811
public function execute()
    {
        $rowId = (int) $this->getRequest()->getParam('id');
        $rowData = $this->_objectManager->create('CheckoutCom\Magento2\Model\Subscription');
        if ($rowId) {
            $rowData = $rowData->load($rowId);
            $rowTitle = $rowData->getTitle();
            if (!$rowData->getEntityId()) {
                $this->messageManager->addError(__('This item no longer exists.'));
                $this->_redirect('checkout_com/subscription/rowdata');
                return;
            }
        }
 
        $this->_coreRegistry->register('row_data', $rowData);
        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        $title = $rowId ? __('Edit Item').$rowTitle : __('Add New Item');
        $resultPage->getConfig()->getTitle()->prepend($title);
        return $resultPage;
    }
285362
public function add() {
        $role = $this->Roles->newEntity();
        if ($this->request->is('post')) {
            $role = $this->Roles->patchEntity($role, $this->request->data);
            if ($this->Roles->save($role)) {
                $this->Flash->success(__('The role has been saved.'));
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error(__('The role could not be saved. Please, try again.'));
            }
        }
        $this->set(compact('role'));
        $this->set('_serialize', ['role']);
        $this->filteredSelectOptions();
    }
148329
public function newAction()
    {
        $permissionsGroup = new PermissionsGroup();
        $form   = $this->createCreateForm($permissionsGroup);

        return $this->render('ChillMainBundle:PermissionsGroup:new.html.twig', array(
            'entity' => $permissionsGroup,
            'form'   => $form->createView(),
        ));
    }
900267
public function newAction()
    {
        $entity = new Menu();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
109738
public function newAction()
    {
        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem(array(
            'title' => 'Language',
            'route' => 'admin_language',
        ));

        $breadcumbs->addItem(array(
            'title' => 'New',
            'route' => '',
        ));

        $form = $this->createForm(new LanguageFormType(), new Language());

        return array(
            'form'   => $form->createView(),
        );
    }
809772
public function newAction()
    {
        $productitemfielddata = new ProductItemFieldData();
        $form = $this->createForm($this->get("amulen.shop.form.product.item.field.data"), $productitemfielddata);

        return array(
            'productitemfielddata' => $productitemfielddata,
            'form' => $form->createView(),
        );
    }
521373
public function add()
    {
        $user = $this->Users->newEntity();
        if ($this->request->is('post')) {
            $user = $this->Users->patchEntity($user, $this->request->getData());
            if (Filter::bool($user->get('notify'))) {
                $user->set('token', Token::generate());
            }

            $result = $this->Users->save($user);
            if ($result) {
                $this->Flash->success(__d('community', 'The user {0} has been saved.', sprintf(
                    '<strong>«%s»</strong>',
                    $result->get('login')
                )));

                return $this->App->redirect(['apply' => ['action' => 'edit', $result->id]]);
            } else {
                $this->Flash->error(__d('community', 'User could not be updated. Please, try again.'));
            }
        }

        $groups = $this->Users->Groups->getTreeList();

        $this
            ->set(compact('user', 'groups'))
            ->set('page_title', __d('community', 'Profiles: Add new user'));
    }
952140
public function build()
    {
        $this->result = new PaginationResult();

        if ($this->total === 0 || $this->limit === 0 || $this->pages === 1) {
            return $this;
        }

        // Lower
        $offset = $this->current - 1;

        // -1 is simple pagination
        if ($this->total === -1) {
            $neighbours = 1;
        } else {
            $neighbours = $this->current - $this->neighbours;
            $neighbours = $neighbours < static::BASE_PAGE ? static::BASE_PAGE : $neighbours;
        }

        for ($i = $offset; $i >= $neighbours; $i--) {
            $this->result->addLower($i);
        }

        if ($neighbours - static::BASE_PAGE >= 2) {
            $this->result->setLess($neighbours - 1);
        }

        $this->result->setPrevious($this->current - 1);

        // First
        if ($this->current - $this->neighbours > static::BASE_PAGE) {
            $this->result->setFirst(static::BASE_PAGE);
        }

        // Higher
        $offset     = $this->current + 1;
        $neighbours = $this->current + $this->neighbours;
        $neighbours = $neighbours > $this->pages ? $this->pages : $neighbours;

        for ($i = $offset; $i <= $neighbours; $i++) {
            $this->result->addHigher($i);
        }

        if ($this->pages - $neighbours > 0) {
            $this->result->setMore($neighbours + 1);
        }

        // Show next button if not last page or for simple pagination
        if ($this->total === -1 || $this->current !== $this->pages) {
            $this->result->setNext($this->current + 1);
        }

        // Last
        if ($this->current + $this->neighbours < $this->pages) {
            $this->result->setLast($this->pages);
        }

        // Current
        $this->result->setCurrent($this->current);

        return $this;
    }
1081008
public function add() {
        $cmsContent = $this->CmsContent->newEntity();
        if ($this->request->is('post')) {
            $cmsContent = $this->CmsContent->patchEntity($cmsContent, $this->request->data);
            if ($this->CmsContent->save($cmsContent)) {
                $this->Flash->success('The cms content has been saved.');
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms content could not be saved. Please, try again.');
            }
        }
        $this->set(compact('cmsContent'));
        $this->set('_serialize', ['cmsContent']);
    }
20563
public function addRow($values=array()) {
		$row=$this->getBody()->addRow($this->_colCount);
		$row->setValues(\array_values($values));
		return $this;
	}
1173092
def add_a_row
      new_rows = rows + 1
      pool, @page_data = @page_data.flatten, []

      until pool.empty?
        @page_data << pool.shift(new_rows)
      end
    end
546435
public function newAction()
    {
        $entity = new SurveyCategory();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
339652
public function newAction()
    {
        $form = $this->container->get('vespolina.product.form');

        return $this->container->get('templating')->renderResponse('VespolinaCommerceBundle:Product:new.html.'.$this->getEngine(), array(
            'form'                   => $form->createView(),
            'configuredOptionGroups' => $this->getConfiguredOptionsGroups(),
            'product'  => $this->container->get('vespolina.product_manager')->createProduct(),
       ));
    }
327582
public function create()
    {
        $template = $this->template->where('active', 1)->where('type', 'admin')->first();
        $templates = $this->template->where('active', 1)->where('type', 'default')->get();
        $pageViews = $this->template->getPageViews();
        return view('chuckcms::backend.pages.create', compact('template', 'templates', 'page', 'pageViews'));
    }
75471
public function newAction()
    {
        $entity = new Tag();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
1084328
protected function addRow()
    {
        $arguments = func_get_args();

        // store the longest column so we can pad out to it on render
        foreach ($arguments as $key => $value) {
            $columnLength = strlen($value);

            if (!isset($this->columnLengthMax[$key]) || $columnLength > $this->columnLengthMax[$key]) {
                $this->columnLengthMax[$key] = $columnLength;
            }
        }

        $this->rows[] = $arguments;
    }
918444
public function newAction()
    {
        $entity = new Category();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }