On Sunday, December 30, 2012 4:39:54 PM UTC-3, cPage wrote: > > > > Le dimanche 30 décembre 2012 13:46:35 UTC-5, cPage a écrit : >> >> The example : >> >> // app/View/Common/view.ctp<--------------------------------------PARENT >> > here is nesesary a div class 'view'
> <h1><?php echo $this->fetch('title'); ?></h1> >> <?php echo $this->fetch('content'); ?> >> /***************/ >> <div class="actions"><----------------default class 16%width and >> float:left >> <h3>Related actions</h3> >> <ul> >> <?php echo $this->fetch('sidebar'); ?> >> </ul> >> </div> >> >> // app/View/Posts/view.ctp<----------------------------CHILD >> $this->extend('/Common/view'); >> >> $this->assign('title', $post);<----------------ERROR >> >> $this->start('sidebar'); >> ?> >> <li> >> <?php >> echo $this->Html->link('edit', array( >> 'action' => 'edit', >> $post['Post']['id'] >> )); ?> >> </li> >> <?php $this->end(); ?> >> >> // The remaining content will be available as the 'content' block >> // in the parent view. >> <?php echo h($post['Post']['body']); >> >> Didn't work ?? I get : >> > > Blocks can only contain strings. > *Error: *An Internal Error Has Occurred. > the correctes code /************************************/ //Sending title variable to Parent Template done man... $this->assign('title', $post);<-------- BAD $this->assign('title', $post['Post']['title']);<------------FINE and the rest outside the sidebar block is sended via 'content' , a special Cake block container for the code outside the block 'sidebar' and in parent i also use a div clas'view', that is a default class for content, float to right and 76% width <div class="view"> <h1><?php echo $this->fetch('title'); ?></h1> <?php echo $this->fetch('content'); ?> </div> -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.