Example #1
0
 /**
  * @return \Paragraph\Model\Paragraph\Structure\Columns
  */
 public function prepareCreate()
 {
     $mapper = $this->getMapper();
     $width = max(1, (int) (100 / $this->columnCount));
     $currw = 100;
     for ($i = $this->columnCount; $i > 0; --$i) {
         if ($i === 1) {
             $initialWidth = $currw;
         } else {
             $initialWidth = $width;
             $currw -= $width;
         }
         $this->bindChild($mapper->create(array('type' => 'column', 'initialWidth' => $initialWidth)));
     }
     return parent::prepareCreate();
 }
Example #2
0
 /**
  * @return \Paragraph\Model\Paragraph\Structure\Column
  */
 public function prepareCreate()
 {
     $mapper = $this->getMapper();
     $this->bindChild($mapper->create(array('type' => 'html')));
     return parent::prepareCreate();
 }