예제 #1
0
 public function testEllipsisWithShort()
 {
     $value = '一弍三';
     $this->expected = '一弍三';
     $this->actual = Str::ellipsis($value, 10, '...');
     $this->assertEquals($this->expected, $this->actual);
 }
예제 #2
0
 /**
  * Name of this extension
  *
  * @return string
  */
 public function getEllipsis($value, $length = 100, $end = '...')
 {
     return Str::ellipsis($value, $length, $end);
 }
예제 #3
0
 /**
  * 複数配送処理がクリックされた場合の処理
  */
 public function shippingMultipleChange(Application $app, Request $request)
 {
     $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']);
     if (!$Order) {
         $app->addError('front.shopping.order.error');
         return $app->redirect($app->url('shopping_error'));
     }
     $form = $app['eccube.service.shopping']->getShippingForm($Order);
     if ('POST' === $request->getMethod()) {
         $form->handleRequest($request);
         $data = $form->getData();
         $message = Str::ellipsis($data['message'], 3000, '');
         $Order->setMessage($message);
         // 受注情報を更新
         $app['orm.em']->flush();
         // 複数配送設定へリダイレクト
         return $app->redirect($app->url('shopping_shipping_multiple'));
     }
     return $app->redirect($app->url('shopping'));
 }