Exemple #1
0
}}</h2>

    <form action="/<?php 
echo $gen->route();
?>
/{{$<?php 
echo $gen->modelVariableName();
?>
->id}}" method="post">

        {{ csrf_field() }}

        {{ method_field("PUT") }}
<?php 
foreach ($fields as $field) {
    if ($str = \Nvd\Crud\Db::getFormInputMarkup($field, $gen->modelVariableName())) {
        ?>

        <?php 
        echo $str;
        ?>

<?php 
    }
}
?>

        <button type="submit" class="btn btn-default">Submit</button>

    </form>
echo $gen->templatesDir();
?>
.common.search-btn')</td>
			</form>
		</tr>
	    </thead>

	    <tbody>
	    	@forelse ( $records as $record )
		    	<tr>
					<?php 
foreach ($fields as $field) {
    ?>
<td>
						<?php 
    if (!\Nvd\Crud\Db::isGuarded($field->name)) {
        ?>
<span class="editable"
							  data-type="<?php 
        echo \Nvd\Crud\Html::getInputType($field);
        ?>
"
							  data-name="<?php 
        echo $field->name;
        ?>
"
							  data-value="{{ $record-><?php 
        echo $field->name;
        ?>
 }}"
							  data-pk="{{ $record->{$record->getKeyName()} }}"
 public function generateViews()
 {
     if (!file_exists($this->viewsDir())) {
         mkdir($this->viewsDir());
     }
     foreach (config('crud.views') as $view) {
         $viewFile = $this->viewsDir() . "/" . $view . ".blade.php";
         if ($this->confirmOverwrite($viewFile)) {
             $content = view($this->templatesDir() . '.views.' . $view, ['gen' => $this, 'fields' => Db::fields($this->tableName)]);
             file_put_contents($viewFile, $content);
             $this->info("View file " . $view . " generated successfully.");
         }
     }
 }
Exemple #4
0
@section('content')

    <h2>Create a New <?php 
echo $gen->titleSingular();
?>
</h2>

    <form action="/<?php 
echo $gen->route();
?>
" method="post">

        {{ csrf_field() }}
<?php 
foreach ($fields as $field) {
    if ($str = \Nvd\Crud\Db::getFormInputMarkup($field)) {
        ?>

        <?php 
        echo $str;
        ?>

<?php 
    }
}
?>

        <button type="submit" class="btn btn-default">Submit</button>

    </form>
Exemple #5
0
.index','<?php 
    echo ucwords(str_replace('_', ' ', $field->name));
    ?>
')!!}
			<?php 
}
?>
<th></th>
		</tr>
		<tr class="search-row">
			<form class="search-form">
				<?php 
foreach ($fields as $field) {
    ?>
<td><?php 
    echo \Nvd\Crud\Db::getSearchInputStr($field);
    ?>
</td>
				<?php 
}
?>
<td style="min-width: 6.1em;">@include('<?php 
echo $gen->templatesDir();
?>
.common.search-btn')</td>
			</form>
		</tr>
	    </thead>

	    <tbody>
	    	@forelse ( $records as $record )