keep format

is there any way so when i copy and paste my code stays the same ?

my code:

$this->DB->build( array(                           'select'   => 't.*',                           'from'     => array( 'credits_trans_log' => 't' ),                           'add_join' => array(                                                 0 => array(                                                              'select' => 'mf.member_id as from_id, mf.members_display_name as from_name, mf.members_seo_name as from_seo',                                                              'from'   => array( 'members' => 'mf'),                                                              'where'  => 't.t_from=mf.member_id',                                                              'type'   => 'left' ),                                                 1 => array(                                                              'select' => 'mt.member_id as to_id, mt.members_display_name as to_name, mt.members_seo_name as to_seo',                                                              'from'   => array( 'members' => 'mt'),                                                              'where'  => 't.t_to=mt.member_id',                                                              'type'   => 'left' ) ),                                                              'order'  => 't.t_date DESC',                                                              'limit'  => array( 0, 10 ) ) );


but then if if i copy and paste it looks like this bellow and i dont wan't to lose the format from above:

$this->DB->build( array(     'select'   => 't.*',     'from'     => array( 'credits_trans_log' => 't' ),     'add_join' => array(         0 => array(             'select' => 'mf.member_id as from_id, mf.members_display_name as from_name, mf.members_seo_name as from_seo',             'from'   => array( 'members' => 'mf'),             'where'  => 't.t_from=mf.member_id',             'type'   => 'left' ),         1 => array(             'select' => 'mt.member_id as to_id, mt.members_display_name as to_name, mt.members_seo_name as to_seo',             'from'   => array( 'members' => 'mt'),             'where'  => 't.t_to=mt.member_id',             'type'   => 'left' ) ),     'order'  => 't.t_date DESC',     'limit'  => array( 0, 10 ) ) );

3 comments

Hello,

do you use tabs for indents? If yes, check your settings (Preferences > Code Stype > PHP). You should have:

Use tab character NOT checked
Tab size: 4
Indent: 4
Continuation indent: 4

Good luck.

0

Hi there,

Settings | Editor | Smart Keys --> Reformat on paste = None

0

Please sign in to leave a comment.