This is a custom form input example. It provide functionality to modify form input. In this example I modify form input for description from textarea to input text.

	$categoryList= $this->getCategoryList();
	$Scaffolding= new Scaffolding("posts");
	$Scaffolding->join('categories', 'categories.id', '=', 'posts.category', 'INNER');
	$Scaffolding->setFormInputFiller("category", $categoryList);
	// Set columns properties
	$parameters= array(
	    array(
	    	'name'=>'no',
	    	'width'=>'1%',
	    ),
	    array(
	    	'name'=>'categories.name',
	    	'label'=>'Category',
	    	'width'=>'30%',
	    ),
	    array(
	    	'name'=>'title',
	    	'width'=>'49%',
	    ),
	    array(
	    	'name'=>'actions',
	    	'width'=>'20%',
	    ),
	);
	$Scaffolding->setColumnProperties($parameters);
	// Modify description form input
	$Scaffolding->setFormInput('description', array($this, 'getFormInputDescription'));
	$content= $Scaffolding->render();
	$parameters= array(
		'scaffolding'=>$content
	);
	return view('demo', $parameters);
	

This is callback for modify description form input.

	/**
	* Get form input description
	* 
	* @param  array $column
	* @param  \App\Libraries\Scaffolding\ScaffoldingTable $Scaffolding
	* 
	* @return  string
	*/
    public function getFormInputDescription($column, $Scaffolding)
    {
    	echo Form::text('description', null, $column['attributes']);
    }
	
Cancel