承接 apoutchika/loremipsum-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

apoutchika/loremipsum-bundle

最新稳定版本:v1.0.3

Composer 安装命令:

composer require apoutchika/loremipsum-bundle

包简介

Generate paragraphs, sentences and words for your development.

README 文档

README

Generate paragraphs, sentences and words for your development

Installation

Download LoremIpsumBundle using composer

Add LoremIpsumBundle in your composer.json

{
    "require": {
        "apoutchika/loremipsum-bundle": "dev-master"
    }
}

Enable the bundle on your kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array (
        //...
        new Apoutchika\LoremIpsumBundle\ApoutchikaLoremIpsumBundle(),
    );
}

Use it on controller :

<?php
$loremIpsum = $this->get('apoutchika.lorem_ipsum');

// $paragraphs1 content is aleatory number of paragraphs
$paragraphs = $loremIpsum->getParagraphs();

// $paragraphs2 content is exactly 2 paragraphs
$paragraphs2 = $loremIpsum->getParagraphs(2);

// $paragraphs3 content 2, 3, 4, 5, 6, 7 or 8 paragraphs
$paragraphs3 = $loremIpsum->getParagraphs(2, 8);


// Or with sentences :
$sentences = $loremIpsum->getSentences(1, 3); // 1, 2 or 3 sentences


// Or with words :
$words = $loremIpsum->getWords (2); // return only two words

Set you'r lorem ipsum value

<?php

// for the customers database :

$liName = $this->get('apoutchika.lorem_ipsum');
$liName->setLoremIpsum ('Dupont Dupond Martin Durand Tessier'); // ....

$liFirstName = $this->get('apoutchika.lorem_ipsum');
$liFirstName->setLoremIpsum ('Marie Jean Michel Pierre Philippe'); //...

$user = new User;
$user->setName ($liName->getWords(1));
$user->setFirstName ($liFirstName->getWords(1));
//...

Use it on Twig :

For generate 2 paragraphs :

{{ paragraphs (2) }}

For generate 2, 3, 4 or 5 paragraphs :

{{ paragraphs (2, 5) }}

For sentences and words:

{{ sentences () }}
{{ words () }}

Configuration Reference

see Resources/doc/configuration_reference.md

Licence

See Resources/meta/LICENSE.

统计信息

  • 总下载量: 59.83k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固