BEST Offers , For All Sximo 5 LTS licence Holer , Upgrade Licence For only $14 Normal Price on Codecanyon $31
New product Sximopress ( Wordpress Builder ) 1.0 has been realesed . download it now !

S5 Ultimate

The Real PHP Application Makers

Custom Template

As default , all generated template using one single file from CrudEngine Class . if you want to make custom template . you need to make sure , you change CRUD themes , using method theme('default').

Method

template()

Param & Arguments

[
    'table' => 'path.to.template', // template for grid table list
    'form'  => 'path_to_form_template', // template for form
    'view'  => 'path_to_view_template', // template for view detail 
    
]

Example Usage

Change table list to your own template
$table     = $this->crudengine->table( $config['table'])->builder( $config )
            ->button( implode(',',$access) )
            ->theme('default')
            ->template(['table'=>'folder.custom_table'])
            ->render();
            
you can change only table , form or view . or you can changes all . just define on array arguments

Template Table Structure

this is minimal code structure for your custom template
@include('CrudEngine.default.toolbar')
 {!! Form::open(array('url'=> $url, 'class'=>'form-vertical','files' => true ,'id'=> $actionId .'table')) !!}
     @foreach($rows as $row)
     <div>
        // your template start here 
        {!! $row['table.fieldname'] !}}
     
     </div>
     @endforeach
 {!! Form::close() !!}

<div class="Page navigation example text-center">    
    {!! $paginator !!}
</div>
<script type="text/javascript">
$(document).ready(function(){
     $('#<?php echo $actionId ;?>').crudEngine({
        action  : '<?php echo url($url);?>',
        id         :  '#{{ $actionId }}'
    });
    $("#<?php echo $actionId ;?> ul.pagination li a").addClass("page-link")
    /* if search is entered */
    $( '#<?php echo $actionId ;?> input[name=onsearch]').keyup(function( e ){
        if (e.keyCode === 13) {
           CrudEngineReload( '{{ url($url."?search=")}}'+$(this).val() , '#{{ $actionId}}');
        }
    })    
    $('#<?php echo $actionId ;?> .checkall').on('click',function() {
        var cblist = $(".ids");
        if($(this).is(":checked"))
        {                
            cblist.prop("checked", !cblist.is(":checked"));
        } else {    
            cblist.removeAttr("checked");
        }    
    });
})    
</script>

Form Template Structure

{!! Form::open(array('url'=> $url, 'class'=>'form-vertical row CrudEngineForm' ,'files' => true , 'parsley-validate'=>'','novalidate'=>' ', 'id' =>$actionId.'-action')) !!}

// Your template begin here
@foreach($forms as $key=>$val)
    @if($this_key != $key)
        <div class="form-group row " >
            <label for="Name" class=" control-label col-md-4 "> {{ $val['title'] }}</label>
            <div class="col-md-8">
                @if(array_key_exists($key, $forms))
                    {!! $val[ 'form'] !!}
                @endif
            </div> 
        </div>    
    @endif
@endforeach
<button class="btn btn-info btn-sm actionButton" data-after-task="return">
             Save & Return 
</button>
        
<input type="hidden" name="pagetype" value="post" />
<input type="hidden" name="{{ $this_key }}" value="{{ $key_value }}" />
<input type="hidden" name="task" value="{{ $task_value }}" />
<input type="hidden" name="data-after-task" id="data-after-task" value="" />

 {!! Form::close() !!}

View Detail Template

<div class="sximo_tools text-right">
    <a href="javascript:void(0)" class="btn btn-default btn-sm" onclick="CrudEngine_Close('#{{ $actionId}}')"><i class="fa fa-times"></i> </a>
</div>    

<table class="table">
    <tbody>
        @foreach($rows as $row)
            @foreach($views as $key=>$val)
            <tr>            
                <td> {{ $val }}</td>
                <td> {!! $row[$key] !!}</td>                            
            </tr>
            @endforeach    
        @endforeach
        
    </tbody
</table>

Please Register Purchased Code for full access Docs


Last Update : 2017-10-14 06:40:23