Ctrl+Shift+F PHP formating. How to prevent new line

General discussion on Zend Studio
Post Reply
romanovsergey
Posts: 2
Joined: Fri Aug 19, 2011 5:54 am

Ctrl+Shift+F PHP formating. How to prevent new line

Post by romanovsergey » Thu Jan 12, 2012 7:12 am

Basically this autoformating works perfectly in PHP code. But as soon as I get in to templates it messup everything. In templates we have this formating style

Code: Select all

<?php if($this->type->params->get('properties.item_title', 1) == 1):?>
	<div class="formelm odd<?php echo $k = 1 - $k ?>">
		<label id="title-lbl" for="jform_title" class="" >
			<?php if($params->get('tmpl_core.form_title_icon', 1)):?>
				<img src="<?php echo JURI::root()?>media/mint/icons/16/edit.png" align="absmiddle">
			<?php endif;?>
			
			<?php echo JText::_($this->tmpl_params->get('tmpl_core.form_label_title', 'Title')) ?>
			<span class="fright hasTip" title="<?php echo JText::_('Required')?>"><img src="<?php echo JURI::root()?>media/mint/icons/16/asterisk-small.png" align="right" /></span>
		</label>
		<?php echo $this->form->getInput('title'); ?>
	</div>
<?php else :?>
	<input type="hidden" name="jform[title]" value="<?php echo ($this->item->title ? $this->item->title : JText::_('No title').': '.time())?>" />
<?php endif;?>
And if i apply formatting it insert new lime after php opening tag <?php and before closing tag ?>

how to prevent that?

User avatar
ganoro
Posts: 409
Joined: Wed Jan 21, 2009 5:00 pm

Re: Ctrl+Shift+F PHP formating. How to prevent new line

Post by ganoro » Thu Jan 12, 2012 11:12 am

what version of zend studio do you use?
I am using Zend Studio 9.0.1 and this is the formatted text:

Code: Select all


<?php if($this->type->params->get('properties.item_title', 1) == 1):?>
<div class="formelm odd<?php echo $k = 1 - $k ?>">
	<label id="title-lbl" for="jform_title" class="">
         <?php if($params->get('tmpl_core.form_title_icon', 1)):?>
            <img
		src="<?php echo JURI::root()?>media/mint/icons/16/edit.png"
		align="absmiddle">
         <?php endif;?>
         
         <?php echo JText::_($this->tmpl_params->get('tmpl_core.form_label_title', 'Title'))?>
         <span class="fright hasTip"
		title="<?php echo JText::_('Required')?>"><img
			src="<?php echo JURI::root()?>media/mint/icons/16/asterisk-small.png"
			align="right" /></span>
	</label>
      <?php echo $this->form->getInput('title'); ?>
   </div>
<?php else :?>
<input type="hidden" name="jform[title]"
	value="<?php echo ($this->item->title ? $this->item->title : JText::_('No title').': '.time())?>" />
<?php endif;?>


avaranger
Posts: 5
Joined: Sun May 03, 2009 9:49 am

Re: Ctrl+Shift+F PHP formating. How to prevent new line

Post by avaranger » Tue Mar 27, 2012 1:30 pm

I also have the same problem. Using ZS for Eclipse...

Code: Select all

Zend Studio
Professional Edition
Build ID: 20110515
www.tomasfejfar.cz

Post Reply