setTitle() public method

public setTitle ( $title )
コード例 #1
0
ファイル: LoadPostData.php プロジェクト: syrotchukandrew/blog
 public function load(ObjectManager $manager)
 {
     $faker = Factory::create();
     for ($i = 0; $i < 50; $i++) {
         static $id = 1;
         $post = new Post();
         $post->setTitle($faker->sentence);
         $post->setAuthorEmail('*****@*****.**');
         $post->setImageName("images/post/foto{$id}.jpg");
         $post->setContent($faker->realText($maxNbChars = 5000, $indexSize = 2));
         $marks = array();
         for ($q = 0; $q < rand(1, 10); $q++) {
             $marks[] = rand(1, 5);
         }
         $post->setMarks($marks);
         $post->addMark(5);
         $manager->persist($post);
         $this->addReference("{$id}", $post);
         $id = $id + 1;
         $rand = rand(3, 7);
         for ($j = 0; $j < $rand; $j++) {
             $comment = new Comment();
             $comment->setAuthorEmail('*****@*****.**');
             $comment->setCreatedBy('user_user');
             $comment->setContent($faker->realText($maxNbChars = 500, $indexSize = 2));
             $comment->setPost($post);
             $post->getComments()->add($comment);
             $manager->persist($comment);
             $manager->flush();
         }
     }
     $manager->flush();
 }
コード例 #2
0
 private function loadPosts(ObjectManager $manager)
 {
     $category = new Category();
     $category->setName('Improvements');
     foreach (range(1, 5) as $i) {
         $post = new Post();
         $post->setTitle($this->getRandomPostTitle());
         $post->setSummary($this->getRandomPostSummary());
         $post->setSlug($this->container->get('slugger')->slugify($post->getTitle()));
         $post->setContent($this->getPostContent());
         $post->setAuthorEmail('*****@*****.**');
         $post->setPublishedAt(new \DateTime('now - ' . $i . 'days'));
         $post->setState($this->getRandomState());
         $post->setCategory($category);
         foreach (range(1, 5) as $j) {
             $comment = new Comment();
             $comment->setAuthorEmail('*****@*****.**');
             $comment->setPublishedAt(new \DateTime('now + ' . ($i + $j) . 'seconds'));
             $comment->setContent($this->getRandomCommentContent());
             $comment->setPost($post);
             $manager->persist($comment);
             $post->addComment($comment);
         }
         if (rand(0, 1)) {
             $vote = new Vote();
             $vote->setAuthorEmail(rand(0, 1) ? '*****@*****.**' : '*****@*****.**');
             $vote->setPost($post);
             $vote->setVote(rand(0, 1));
         }
         $manager->persist($post);
         $category->addPost($post);
     }
     $manager->flush();
 }
コード例 #3
0
ファイル: LoadFixtures.php プロジェクト: alegperea/CMS
 private function loadPosts(ObjectManager $manager)
 {
     foreach (range(1, 30) as $i) {
         $post = new Post();
         $post->setTitle('Sed ut perspiciatis unde');
         $post->setAlias('Sed ut perspiciatis unde');
         $post->setIntrotext('Sed ut perspicantium, tocto beatae vitae dicta sunt explicabo. ');
         $post->setSlug($this->container->get('slugger')->slugify($post->getTitle()));
         $post->setBody('Sed ut is iste uasi architecto beatae vitae dicta sunt explicabo. ');
         $post->setAuthorEmail('*****@*****.**');
         $post->setPublishedAt(new \DateTime('now - ' . $i . 'days'));
         $post->setState(1);
         $post->setImages('test.jpg');
         foreach (range(1, 5) as $j) {
             $comment = new Comment();
             $comment->setAuthorEmail('*****@*****.**');
             $comment->setPublishedAt(new \DateTime('now + ' . ($i + $j) . 'seconds'));
             $comment->setContent('Sed ut perspiciatis undedasdadasd');
             $comment->setPost($post);
             $manager->persist($comment);
             $post->addComment($comment);
         }
         $manager->persist($post);
     }
     $manager->flush();
 }
コード例 #4
0
 /**
  * @Route("/create", name="create_objects")
  *
  * @Rest\View()
  *
  * @return Response
  */
 public function createAction()
 {
     // We need an entity manager here
     $em = $this->getDoctrine()->getManager();
     // First, we try to create a post
     $post = new Post();
     $post->setTitle('Hello World');
     $post->setContent('This is a hello world post');
     $post->setCreated(new \DateTime());
     $em->persist($post);
     // Create new post log object
     $postLog = new PostLog();
     $postLog->setMessage('A new post was created');
     $postLog->setCreated(new \DateTime());
     $postLog->setParent($post);
     $em->persist($postLog);
     // Try to create a category
     $category = new Category();
     $category->setTitle('A Category');
     $category->setDescription('A category to created');
     $em->persist($category);
     // Create new category log object
     $categoryLog = new CategoryLog();
     $categoryLog->setMessage('A new category was created');
     $categoryLog->setCreated(new \DateTime());
     $categoryLog->setParent($category);
     $em->persist($categoryLog);
     // Actually store all the entities to the database
     // to get id of the post and the category
     $em->flush();
     return ['Done'];
 }
コード例 #5
0
ファイル: LoadFixtures.php プロジェクト: red4r00t/Blog
 public function load(ObjectManager $manager)
 {
     // TODO: Implement load() method.
     $category = new Category();
     $category->setName('Default');
     $manager->persist($category);
     foreach (range(1, 100) as $i) {
         $post = new Post();
         $post->setTitle($this->getPostTitle());
         $post->setSlug($this->container->get('slugger')->slugify($post->getTitle()));
         $post->setImage('post.jpeg');
         $post->setContent($this->getPostContent());
         $post->setAuthor('gunyem');
         $post->setCreated(new \DateTime('now - ' . $i . 'days'));
         $post->setUpdated(new \DateTime('now - ' . $i . 'days'));
         $post->setCategory($category);
         foreach (range(1, 10) as $j) {
             $comment = new Comment();
             $comment->setPost($post);
             $comment->setContent($this->getPostTitle());
             $comment->setAuthor('gunyem');
             $comment->setCreated(new \DateTime('now + ' . ($i + $j) . 'seconds'));
             $manager->persist($comment);
             $post->createComment($comment);
         }
         $manager->persist($post);
     }
     $manager->flush();
 }
コード例 #6
0
 private function loadPosts(ObjectManager $manager)
 {
     $passwordEncoder = $this->container->get('security.password_encoder');
     $user = new User();
     $user->setUsername('vvasia');
     $user->setDisplayName('Vasia Vasin');
     $user->setEmail('*****@*****.**');
     $user->setUuid('uuid');
     $encodedPassword = $passwordEncoder->encodePassword($user, 'password');
     $user->setPassword($encodedPassword);
     $user->setRoles(['ROLE_USER']);
     $manager->persist($user);
     $manager->flush();
     /** @var User $author */
     $author = $manager->getRepository('AppBundle:User')->findOneBy(['email' => '*****@*****.**']);
     foreach (range(1, 10) as $i) {
         $post = new Post();
         $post->setTitle($this->getRandomPostTitle() . ' ' . uniqid())->setSummary($this->getRandomPostSummary())->setSlug($this->container->get('slugger')->slugify($post->getTitle()))->setContent($this->getPostContent())->setAuthor($author)->setPublishedAt(new \DateTime('now - ' . $i . 'days'))->setState($this->getRandomState())->setCategory($category);
         foreach (range(1, 5) as $j) {
             $comment = new Comment();
             $comment->setUser($user)->setPublishedAt(new \DateTime('now + ' . ($i + $j) . 'seconds'))->setContent($this->getRandomCommentContent())->setPost($post);
             $manager->persist($comment);
             $post->addComment($comment);
         }
         if (rand(0, 1)) {
             $vote = new Vote();
             $vote->setAuthorEmail(rand(0, 1) ? '*****@*****.**' : '*****@*****.**');
             $vote->setPost($post);
             $vote->setVote(rand(0, 1));
         }
         $manager->persist($post);
         $category->addPost($post);
     }
     $manager->flush();
 }
コード例 #7
0
 public function load(ObjectManager $manager)
 {
     $repo = new Post();
     $repo->setTitle('Post title 1');
     $manager->persist($repo);
     $repo = new Post();
     $repo->setTitle('Post title 2');
     $manager->persist($repo);
     $manager->flush();
 }
コード例 #8
0
ファイル: LoadPostData.php プロジェクト: barth7/symfony-blog
 public function load(ObjectManager $manager)
 {
     $post = new Post();
     $post->setTitle('test test');
     $post->setSlug('test-test');
     $post->setContent('przykladowy wpis');
     $post->setAuthor('bart');
     $manager->persist($post);
     $manager->flush();
 }
コード例 #9
0
ファイル: Post.php プロジェクト: Wobbly-Wibbly/sfTestProject
 public function load(ObjectManager $manager)
 {
     foreach ($this->getData() as $payload) {
         $post = new Entity\Post();
         $post->setTitle($payload[0]);
         $post->setContent($payload[1]);
         $post->setCreated($payload[2]);
         $manager->persist($post);
     }
     $manager->flush();
 }
コード例 #10
0
 public function load(ObjectManager $manager)
 {
     $faker = new Faker\Generator();
     $faker->addProvider(new Faker\Provider\en_US\Text($faker));
     $faker->addProvider(new Faker\Provider\Lorem($faker));
     for ($i = 1; $i <= 100; $i++) {
         $post = new Post();
         $post->setTitle($faker->sentence(4));
         $post->setBody($faker->realText(500));
         $manager->persist($post);
     }
     $manager->flush();
 }
コード例 #11
0
 function load(ObjectManager $manager)
 {
     $i = 1;
     while ($i < +100) {
         $post = new Post();
         $post->setTitle('Titre du post n°' . $i);
         $post->setBody('Corps du post');
         $post->setIsPublished($i % 2);
         $manager->persist($post);
         $i++;
     }
     $manager->flush();
 }
コード例 #12
0
ファイル: LoadPostData.php プロジェクト: januszweb/sfBlog
 public function load(ObjectManager $manager)
 {
     $faker = \Faker\Factory::create();
     for ($i = 1; $i <= 1000; $i++) {
         $post = new Post();
         $post->setTitle($faker->sentence(15));
         $post->setLead($faker->text(300));
         $post->setContent($faker->text(700));
         $post->setCreatedAt($faker->dateTimeThisMonth);
         $manager->persist($post);
     }
     $manager->flush();
 }
コード例 #13
0
 public function create(User $user, $title, $url, $tag)
 {
     if ($errors = $this->getErrors($title, $url, $tag)) {
         throw new ServiceException($errors);
     }
     $post = new Post();
     $post->setUser($user);
     $post->setTitle($title);
     $post->setUrl($url);
     $post->setTag($this->formatTag($tag));
     $post->setUpvoteTotal(0);
     $post->setCreatedAt(new \DateTime());
     return $this->repository->create($post);
 }
コード例 #14
0
 public function testRabbitMQ()
 {
     $client = static::createClient();
     $post = new Post();
     $post->setTitle('Lorem ipsum dolor');
     $post->setSlug('Lorem-ipsum-dolor');
     $post->setSummary('Lorem ipsum dolor sit amet consectetur adipiscing elit Urna nisl sollicitudin');
     $post->setContent('Lorem ipsum dolor sit amet consectetur adipiscing elit Urna nisl sollicitudin');
     $post->setAuthorEmail('*****@*****.**');
     $this->entityManager->persist($post);
     $this->entityManager->flush();
     $client->request('POST', '/post/generate_pdf/' . $post->getId());
     $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
     $pdfName = json_decode($client->getResponse()->getContent(), true)['pdfName'];
     $this->entityManager->remove($post);
     $this->entityManager->flush();
     $pdfPath = self::$kernel->getRootDir() . '/../web/downloads/pdf/' . $pdfName . '.pdf';
     sleep(2);
     $this->assertTrue(file_exists($pdfPath));
     unlink($pdfPath);
 }
コード例 #15
0
 public function testElasticSearch()
 {
     $client = self::createClient();
     $crawler = $client->request('GET', '/blog/search-results?q=odio');
     $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
     $this->assertEquals('Results for <b>odio</b> (5)', $crawler->filter('h2#results-info>span')->html());
     $randnumber = rand();
     $post = new Post();
     $post->setTitle('Elasticsearch rocks ' . $randnumber);
     $post->setSlug('elasticsearch-rocks-' . $randnumber);
     $post->setSummary('Lorem ipsum dolor sit amet consectetur adipiscing elit Urna nisl sollicitudin');
     $post->setContent('Lorem ipsum dolor sit amet consectetur adipiscing elit Urna nisl sollicitudin');
     $post->setAuthorEmail('*****@*****.**');
     $this->entityManager->persist($post);
     $this->entityManager->flush();
     self::populateElasticSearchIndices();
     $crawler = $client->request('GET', '/blog/search-results?q=Elasticsearch rocks ' . $randnumber);
     $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
     $this->assertEquals('Results for <b>Elasticsearch rocks ' . $randnumber . '</b> (1)', $crawler->filter('h2#results-info>span')->html());
     $this->entityManager->remove($post);
     $this->entityManager->flush();
 }
コード例 #16
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $post = new Post();
     $post->setTitle('Man must explore, and this is exploration at its greatest');
     $post->setDescription('Never in all their history have men been able truly to conceive of 
                             the world as one: a single sphere, a globe, having the qualities of 
                             a globe, a round earth in which all the directions eventually meet, 
                             in which there is no center because every point, or none, is center — 
                             an equal earth which all men occupy as equals. The airman\'s earth, if
                             free men make it, will be truly round: a globe in practice, not in theory.');
     $post->setUser($manager->merge($this->getReference('super_admin_user')));
     $post->setIsActive(1);
     $post->setCreatedOn(new \DateTime());
     $post->setUpdatedOn(new \DateTime());
     $post1 = new Post();
     $post1->setTitle('New in Symfony 2.6: Bootstrap form theme');
     $post1->setDescription('Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing 
                             responsive, mobile first projects on the web. Bootstrap is so widely used that it 
                             has become the de facto standard for frontend development. That\'s why Symfony 2.6 
                             will include a new form theme designed for Bootstrap 3.');
     $post1->setUser($manager->merge($this->getReference('super_admin_user')));
     $post1->setIsActive(1);
     $post1->setCreatedOn(new \DateTime());
     $post1->setUpdatedOn(new \DateTime());
     $post2 = new Post();
     $post2->setTitle('Symfony Doctine data fixtures');
     $post2->setDescription('Fixtures are used to load a controlled set of data into a database. This data 
                             can be used for testing or could be the initial data required for the application
                             to run smoothly. Symfony2 has no built in way to manage fixtures but Doctrine2 has 
                              a library to help you write fixtures for the Doctrine ORM or ODM.');
     $post2->setUser($manager->merge($this->getReference('super_admin_user')));
     $post2->setIsActive(1);
     $post2->setCreatedOn(new \DateTime());
     $post2->setUpdatedOn(new \DateTime());
     $manager->persist($post);
     $manager->persist($post1);
     $manager->persist($post2);
     $manager->flush();
 }
コード例 #17
0
ファイル: LoadFixtures.php プロジェクト: Arakaki/symfony-demo
 private function loadPosts(ObjectManager $manager)
 {
     foreach (range(1, 10) as $i) {
         $post = new Post();
         $post->setTitle($this->getRandomPostTitle());
         $post->setSummary($this->getRandomPostSummary());
         $post->setSlug($this->container->get('slugger')->slugify($post->getTitle()));
         $post->setContent($this->getPostContent());
         $post->setAuthorEmail('*****@*****.**');
         $post->setPublishedAt(new \DateTime('now - ' . $i . 'days'));
         foreach (range(1, 5) as $j) {
             $comment = new Comment();
             $comment->setAuthorEmail('*****@*****.**');
             $comment->setPublishedAt(new \DateTime('now + ' . ($i + $j) . 'seconds'));
             $comment->setContent($this->getRandomCommentContent());
             $comment->setPost($post);
             $manager->persist($comment);
             $post->addComment($comment);
         }
         $manager->persist($post);
     }
     $manager->flush();
 }
コード例 #18
0
 /**
  * {@inheritDoc}
  */
 public function setTitle($title)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setTitle', array($title));
     return parent::setTitle($title);
 }
コード例 #19
0
ファイル: LoadData.php プロジェクト: sitobcn82/ruben.baraut
 public function load(ObjectManager $manager)
 {
     $tagSymfony = new Tag('Symfony', false);
     $tagCakephp = new Tag('Cake PHP', false);
     $tagHtml = new Tag('Html5', false);
     $tagCake = new Tag('Cake PHP', false);
     $tagPrestashop = new Tag('Prestashop', false);
     $tagTxema = new Tag('Disseny: Txema Morales', true);
     $tagEsther = new Tag('Disseny: Esther Ferrutz', true);
     $tagFados = new Tag('Col·laboració: Fados Produccions', true);
     $tagWave = new Tag('Col·laboració: Wavecontrol', true);
     $manager->persist($tagSymfony, true);
     $manager->persist($tagCakephp, true);
     $manager->persist($tagCake, true);
     $manager->persist($tagPrestashop, true);
     $manager->persist($tagTxema, true);
     $work1 = new Work('Wavecontrol', 'http://www.wavecontrol.com', 'wavecontrol_web.jpg');
     $work1->addTags($tagSymfony);
     $work1->addTags($tagHtml);
     $work1->addTags($tagWave);
     $manager->persist($work1);
     $work2 = new Work('Dichaea', 'http://www.dichaea.com', 'dichaea.jpg');
     $work2->addTags($tagSymfony);
     $work2->addTags($tagHtml);
     $work2->addTags($tagTxema);
     $manager->persist($work2);
     $work3 = new Work('Fesadent', 'http://www.fesadent.com', 'fesadent.jpg');
     $work3->addTags($tagSymfony);
     $work3->addTags($tagHtml);
     $work3->addTags($tagTxema);
     $manager->persist($work3);
     $work4 = new Work('Nexe', 'http://www.nexe.com', 'nexe.jpg');
     $work4->addTags($tagSymfony);
     $work4->addTags($tagHtml);
     $work4->addTags($tagFados);
     $manager->persist($work4);
     $work5 = new Work('La Keka', 'http://www.lakeka.es', 'lakeka.jpg');
     $work5->addTags($tagSymfony);
     $work5->addTags($tagHtml);
     $work5->addTags($tagEsther);
     $manager->persist($work5);
     $work6 = new Work('Genoxage', 'http://www.genoxage.com', 'genoxage.jpg');
     $work6->addTags($tagSymfony);
     $work6->addTags($tagHtml);
     $work6->addTags($tagFados);
     $manager->persist($work6);
     $work7 = new Work('Challenge Barcelona', 'http://www.challenge-barcelona.com', 'challenge.jpg');
     $work7->addTags($tagSymfony);
     $work7->addTags($tagHtml);
     $work7->addTags($tagFados);
     $manager->persist($work7);
     $work8 = new Work('Fitohobby', 'http://www.fitohobby.com', 'fito.jpg');
     $work8->addTags($tagSymfony);
     $work8->addTags($tagHtml);
     $work8->addTags($tagFados);
     $manager->persist($work8);
     $work9 = new Work('2345 Arquitectes', 'http://www.2345.cat', '2345.jpg');
     $work9->addTags($tagSymfony);
     $work9->addTags($tagHtml);
     $work9->addTags($tagEsther);
     $manager->persist($work9);
     $post1 = new Post();
     $post1->setTitle('Benvinguts al blog tecnològic de Baraut.cat!');
     $post1->setTeaser("<p>Hola a tothom! Aquesta entrada és només la primera de lo que espero que sigui una llarga\n        llista d'entrades relacionades amb les coses que més m'agraden, és a dir, la tecnologia i la programació.</p>\n        <p>Em passo el dia desenvolupant en entorns web i voldria compartir amb vosaltres totes aquelles coses que quan les soluciono penso ..\n        'ruben que bo que ets'. Potser a molts lectors els hi semblen coses òbvies però en quan m'han passat us ben asseguro que les he passat canutes per a solucionar-ho</p>\n        <p>Moltes de les coses estaran relacionades amb Symfony, per mi, dels millors Frameworks en PHP que existeixen.</p>\n        <p>Intentaré explicar-ho de la forma més clara possible, si en algo vaig equivocat, acepto tot tipus de comentaris</p>");
     $post1->setText(null);
     $post1->setDate(new \Datetime('15-11-2015'));
     $post1->setType(POST::TYPE_TECNOLOGIC);
     $post1->setImage('mac.jpg');
     $post1->setLinkSingle(false);
     $manager->persist($post1);
     $post1 = new Post();
     $post1->setTitle('Benvinguts al blog de cuina de Baraut.cat!');
     $post1->setTeaser("\n        <p>Hola a tothom! Aquesta entrada és només la primera de lo que espero que sigui una llarga\n        llista d'entrades relacionades amb una de les coses que més m'agraden: el menjar.</p>\n        <p>He de dir que no en\n        tinc ni idea de cuina, i és per això que faig aquest blog. Només intento ajudar a totes aquelles persones que els\n        hi passa el mateix que a mi. És a dir, que es posen davant de la cuina i no saben ni com han de pelar un tomàquet.</p>\n        <p>Com en tot a la vida, només és qüestió de practicar (espero) i per tant aquí aniré penjant les petites receptes que vagi provant de fer i espero que vosaltres valoreu si el progrés és bo.</p>\n        <p>I Ja us aviso que tant si és bo com si és dolent, un servidor no deixarà ni una molla a ningún plat! </p>");
     $post1->setText(null);
     $post1->setDate(new \Datetime('15-11-2015'));
     $post1->setType(POST::TYPE_CULINARI);
     $post1->setLinkSingle(false);
     $post1->setImage('tomaquets.jpg');
     $manager->persist($post1);
     $post1 = new Post();
     $post1->setTitle("Codi d'aquesta web");
     $post1->setTeaser("<p>Si algú té curiositat per veure com està feta aquesta web, us passo l'enllaç al github, qualsevol errada / millora serà benvinguda. <a href='https://github.com/sitobcn82/ruben.baraut'>https://github.com/sitobcn82/ruben.baraut</a></p>\n        <p>El template utilitzat està extret de  <a target='_blank' href='http://pozhilov.com'> **Sergey Pozhilov**</a></p>\n        <p>La web està encara en fase de desenvolupament i encara no disposa de Backend pel que la carrega de continguts la faig mitjançant fixtures.</p>\n        <p>Ara mateix els bundles externs més significatius són <ul><li>friendsofsymfony/comment-bundle : Per habilitar els comentaris dels posts</li><li>knplabs/knp-paginator-bundle: Per paginar els resultats dels llistats de posts</li></ul></p>\n        <p>Els següents passos que m'agradaria fer són:<ul><li>Posts amb Audio</li><li>Navegador de Tags</li><li>Cercador</li><li>Backend</li><li>Api per a la pujada de dades</li></ul></p>");
     $post1->setText(null);
     $post1->setDate(new \Datetime('16-11-2015'));
     $post1->setType(POST::TYPE_TECNOLOGIC);
     $post1->setImage(null);
     $post1->setLinkSingle(false);
     $manager->persist($post1);
     $post1 = new Post();
     $post1->setTitle("Primera a la frente, Symfony2 - Nginx i Error 404 a tots els assets");
     $post1->setTeaser("<p>Després de varis intents d'intentar pujar a produccció aquesta web, avui m'he decidit a pujar-la.</p>\n        <p>Després de fer el deploy de la aplicació i de configurar el apache em trobava amb el problema de que cap dels assets de la web es mostraven, tots retornaven error 404 perquè estaven tots sense el prefixe /web.</p>\n        <p>Primer de tot he pensat que per despistat m'havia deixat alguna de les coses bàsiques i les he tornat a fer : <ul><li>php app/console assets:install</li><li>php app/console assetic:dump</li><li>php app/console cache:clear --no-warmup --env=prod</li></ul>\n        I res, la web seguia funcionant però cap dels assets es veien correctament. A continució he pensat que seria la configuració del apache i dels virtualhosts, però la configuració estava ben feta. (gràcies a <a href=\"http://symfony.es/documentacion/como-configurar-bien-apache-para-las-aplicaciones-symfony2\">aquesta guia de Symfony.es)</a> </p><p>Finalment mirant els logs d'error del apache he trobat que s'estava executant Nginx Proxy per sobre del apache, i que estava capturant tots els fitxers estàtics d'un directori que no era el documentRoot del symfony (és a dir sense el /web) </p>\n        <p>En resum, si Nginx està funcionant al vostre servidor, apart de configurar el apache per a treballar amb symfony, assegureu-vos que el fitxer de configuració del Nginx conté la mateixa configuració en quan a directoris que el apache</p>");
     $post1->setText(null);
     $post1->setDate(new \Datetime('26-11-2015'));
     $post1->setType(POST::TYPE_TECNOLOGIC);
     $post1->setImage(null);
     $post1->setLinkSingle(false);
     $manager->persist($post1);
     $manager->flush();
 }
コード例 #20
0
 /**
  * {@inheritdoc}
  */
 public function load(ObjectManager $manager)
 {
     $post = new Post();
     $post->setTitle('Cras dignissim vestibulum ultrices');
     $post->setSummary($this->getPostSummary());
     $post->setContent($this->getPostContent());
     $post->setAuthor($this->getReference('user-john_admin'));
     $post->setCategory($this->getReference('category-Vestibulum'));
     $post->addTag($this->getReference('tag-volutpat'));
     $post->addTag($this->getReference('tag-enim'));
     $post->addTag($this->getReference('tag-bibendum'));
     $manager->persist($post);
     $this->setReference('post-1', $post);
     $post = new Post();
     $post->setTitle('Neque porro quisquam est qui dolorem');
     $post->setSummary($this->getPostSummary());
     $post->setContent($this->getPostContent());
     $post->setAuthor($this->getReference('user-john_admin'));
     $post->setCategory($this->getReference('category-Dolorem'));
     $post->addTag($this->getReference('tag-uspendisse'));
     $post->addTag($this->getReference('tag-imperdiet'));
     $post->addTag($this->getReference('tag-ullamcorper'));
     $manager->persist($post);
     $this->setReference('post-2', $post);
     $post = new Post();
     $post->setTitle('Ut enim ad minim veniam, quis nostrud');
     $post->setSummary($this->getPostSummary());
     $post->setContent($this->getPostContent());
     $post->setAuthor($this->getReference('user-john_admin'));
     $post->setCategory($this->getReference('category-Nostrud'));
     $post->addTag($this->getReference('tag-lacus'));
     $post->addTag($this->getReference('tag-aliquam'));
     $post->addTag($this->getReference('tag-eumassa'));
     $manager->persist($post);
     $this->setReference('post-3', $post);
     $post = new Post();
     $post->setTitle('Duis aute irure dolor in reprehenderit');
     $post->setSummary($this->getPostSummary());
     $post->setContent($this->getPostContent());
     $post->setAuthor($this->getReference('user-john_admin'));
     $post->setCategory($this->getReference('category-Reprehenderit'));
     $post->addTag($this->getReference('tag-utnunc'));
     $post->addTag($this->getReference('tag-gravida'));
     $post->addTag($this->getReference('tag-ullamcorper'));
     $manager->persist($post);
     $this->setReference('post-4', $post);
     $post = new Post();
     $post->setTitle('Excepteur sint occaecat cupidatat proident');
     $post->setSummary($this->getPostSummary());
     $post->setContent($this->getPostContent());
     $post->setAuthor($this->getReference('user-john_admin'));
     $post->setCategory($this->getReference('category-Dolorem'));
     $post->addTag($this->getReference('tag-uspendisse'));
     $post->addTag($this->getReference('tag-maecenas'));
     $post->addTag($this->getReference('tag-justo'));
     $manager->persist($post);
     $this->setReference('post-5', $post);
     $post = new Post();
     $post->setTitle('Aenean eget lobortis lectus');
     $post->setSummary($this->getPostSummary());
     $post->setContent($this->getPostContent());
     $post->setAuthor($this->getReference('user-john_admin'));
     $post->setCategory($this->getReference('category-Dolorem'));
     $post->addTag($this->getReference('tag-consectetur'));
     $post->addTag($this->getReference('tag-imperdiet'));
     $post->addTag($this->getReference('tag-facilisis'));
     $manager->persist($post);
     $this->setReference('post-6', $post);
     $manager->flush();
 }
コード例 #21
0
 public function load(ObjectManager $manager)
 {
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151201T12:00'));
     $p1->setPublish(true);
     $p1->setTitle('Installation de Symfony');
     $p1->setAbstract("Ce tutoriel présente l'installation du framework symfony dans sa dernière version stable. C'est une base pour commencer à développer une application web avec. Il couvre l'installation du serveur apache, mysql ainsi que le langage php et l'interface d'administration de base de donnée phpmyadmin.");
     $article = "Installer les prérequis";
     $article = $article . "\n" . "----------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "liste=\\";
     $article = $article . "\n" . "apache2 \\";
     $article = $article . "\n" . "php5 \\";
     $article = $article . "\n" . "mysql-server \\";
     $article = $article . "\n" . "libapache2-mod-php5 \\";
     $article = $article . "\n" . "php5-mysql \\";
     $article = $article . "\n" . "phpmyadmin \\";
     $article = $article . "\n" . "php5-intl\"";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "sudo apt-get install \$liste";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "sudo sed -i -e 's/;date.timezone =/date.timezone = Europe\\/Paris/g' /etc/php5/apache2/php.ini";
     $article = $article . "\n" . "sudo sed -i -e 's/;date.timezone =/date.timezone = Europe\\/Paris/g' /etc/php5/cli/php.ini";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Installer symfony et un alias";
     $article = $article . "\n" . "------------------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony";
     $article = $article . "\n" . "sudo chmod a+x /usr/local/bin/symfony";
     $article = $article . "\n" . "echo alias sy=\\\"php app/console\\\" >> \$HOME/.bashrc";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Installer composer";
     $article = $article . "\n" . "------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "curl -sS https://getcomposer.org/installer | php";
     $article = $article . "\n" . "sudo mv composer.phar /usr/local/bin/composer";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Sources :";
     $article = $article . "\n" . "---------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "1. http://symfony.com/download";
     $article = $article . "\n" . "2. http://doc.ubuntu-fr.org/composer";
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $manager->persist($p1);
     $manager->flush();
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151202T12:00'));
     $p1->setPublish(true);
     $p1->setTitle('Installer et configurer un projet symfony');
     $p1->setAbstract("Comment démarrer la toute base d'un projet symfony ? Cette article répond aux questions de configuration mail pour le dev, creation du projet, mise en relation de symfony avec sublime text. Il faut aussi gérer les droits que vous donner à apache ou autre serveur ! Sinon il ne pourra pas écrire dans le dossier de cache et de logs ainsi que les fichiers que vous uploaderez !");
     $article = "Installation des fichiers";
     $article = $article . "\n" . "-------------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "# installe la dernière version LTS";
     $article = $article . "\n" . "symfony new my_project lts";
     $article = $article . "\n" . "cd my_project";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "mkdir web/uploads";
     $article = $article . "\n" . "HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\\  -f1`";
     $article = $article . "\n" . "# ajouter les dossiers dans lesquels ils faut écrire";
     $article = $article . "\n" . "sudo setfacl -R -m u:\"\$HTTPDUSER\":rwX -m u:`whoami`:rwX app/cache app/logs web/uploads";
     $article = $article . "\n" . "sudo setfacl -dR -m u:\"\$HTTPDUSER\":rwX -m u:`whoami`:rwX app/cache app/logs web/uploads";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Configuration des fichiers";
     $article = $article . "\n" . "---------------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "### parameters.yml";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "La base de donnée, c'est facile";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Pour les mails :";
     $article = $article . "\n" . "```yml";
     $article = $article . "\n" . "parameters:";
     $article = $article . "\n" . "    mailer_transport: gmail";
     $article = $article . "\n" . "    mailer_host: ~";
     $article = $article . "\n" . "    mailer_user:  your_gmail_username";
     $article = $article . "\n" . "    mailer_password:  your_gmail_password";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "### config.yml";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```yml";
     $article = $article . "\n" . "parameters:";
     $article = $article . "\n" . "    locale: fr|en";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "framework:";
     $article = $article . "\n" . "    ide: \"subl:///%%f:%%1\"";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "**Note :** Il faut installer le paquet \"subl protocol\" dans sublime text pour avoir les liens";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Sources :";
     $article = $article . "\n" . "-------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "1. http://symfony.com/fr/doc/current/book/installation.html";
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $manager->persist($p1);
     $manager->flush();
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151203T12:00'));
     $p1->setPublish(true);
     $p1->setTitle("Configuration d'assetic et de bootstrap-bundle");
     $p1->setAbstract("Configuration de assetic associer a bootstrap bundle. Ces deux bundles vous permettront de gérer très facilement la minification de vos sources css, js. Mais aussi de créer des formulaires avec le style de bootstrap aussi facilement que le template de base qu'utilise symfony. Si vous voulez allez plus loin. Je vous montre aussi comment utiliser knp-menu-bundle pour faire des menus bootstrap.");
     $article = "Step 1 : Installer less, bootstrap, jquery, jsqueeze";
     $article = $article . "\n" . '--------------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'composer require twbs/bootstrap \'^3.3\'';
     $article = $article . "\n" . 'composer require components/jquery \'^1.11\'';
     $article = $article . "\n" . 'composer require patchwork/jsqueeze \'~1.0\'';
     $article = $article . "\n" . 'composer require braincrafted/bootstrap-bundle \'~2.0\'';
     $article = $article . "\n" . 'composer require symfony/assetic-bundle';
     $article = $article . "\n" . 'sudo apt-get install java-common nodejs npm';
     $article = $article . "\n" . 'sudo ln -s /usr/bin/nodejs /usr/bin/node # only needed on ubuntu 14.04 <=';
     $article = $article . "\n" . 'sudo npm install -g less';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 2 : Ajouter le bundle au AppKernel.php';
     $article = $article . "\n" . '-------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```php';
     $article = $article . "\n" . 'class AppKernel extends Kernel';
     $article = $article . "\n" . '{';
     $article = $article . "\n" . '    public function registerBundles()';
     $article = $article . "\n" . '    {';
     $article = $article . "\n" . '        $bundles = array(';
     $article = $article . "\n" . '            // ...';
     $article = $article . "\n" . '            new Symfony\\Bundle\\AsseticBundle\\AsseticBundle(),';
     $article = $article . "\n" . '            new Braincrafted\\Bundle\\BootstrapBundle\\BraincraftedBootstrapBundle(),';
     $article = $article . "\n" . '        );';
     $article = $article . "\n" . '        // ...';
     $article = $article . "\n" . '    }';
     $article = $article . "\n" . '}';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 3 : Configurer les paramètres';
     $article = $article . "\n" . '----------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Dans app/config/config.yml';
     $article = $article . "\n" . '```yml';
     $article = $article . "\n" . 'assetic:';
     $article = $article . "\n" . '    filters:';
     $article = $article . "\n" . '        less:';
     $article = $article . "\n" . '            node: /usr/bin/node';
     $article = $article . "\n" . '            node_paths: [/usr/local/lib/node_modules]';
     $article = $article . "\n" . '            apply_to: "\\.less$"';
     $article = $article . "\n" . '        cssrewrite: ~';
     $article = $article . "\n" . '        jsqueeze: ~';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'braincrafted_bootstrap:';
     $article = $article . "\n" . '    output_dir:';
     $article = $article . "\n" . '    assets_dir: %kernel.root_dir%/../vendor/twbs/bootstrap';
     $article = $article . "\n" . '    jquery_path: %kernel.root_dir%/../vendor/components/jquery.min.js';
     $article = $article . "\n" . '    less_filter: less';
     $article = $article . "\n" . '    fonts_dir: %kernel.root_dir%/../web/fonts';
     $article = $article . "\n" . '    auto_configure:';
     $article = $article . "\n" . '        assetic: true';
     $article = $article . "\n" . '        twig: true';
     $article = $article . "\n" . '        knp_menu: true';
     $article = $article . "\n" . '        knp_paginator: true';
     $article = $article . "\n" . '    customize:';
     $article = $article . "\n" . '        variables_file: ~';
     $article = $article . "\n" . '        bootstrap_output: %kernel.root_dir%/Resources/less/bootstrap.less';
     $article = $article . "\n" . '        bootstrap_template: BraincraftedBootstrapBundle:Bootstrap:bootstrap.less.twig';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 4 : auto install the glyphicons and fonts';
     $article = $article . "\n" . '----------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```json';
     $article = $article . "\n" . '{';
     $article = $article . "\n" . '    ...';
     $article = $article . "\n" . '    "scripts": {';
     $article = $article . "\n" . '        "post-install-cmd": [';
     $article = $article . "\n" . '            ...';
     $article = $article . "\n" . '            "Braincrafted\\\\Bundle\\\\BootstrapBundle\\\\Composer\\\\ScriptHandler::install"';
     $article = $article . "\n" . '        ],';
     $article = $article . "\n" . '        "post-update-cmd": [';
     $article = $article . "\n" . '            ...';
     $article = $article . "\n" . '            "Braincrafted\\\\Bundle\\\\BootstrapBundle\\\\Composer\\\\ScriptHandler::install"';
     $article = $article . "\n" . '        ]';
     $article = $article . "\n" . '    }';
     $article = $article . "\n" . '    ...';
     $article = $article . "\n" . '}';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 5 : Mettre à jour le projet (installera les fonts)';
     $article = $article . "\n" . '-------------------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'composer update';
     $article = $article . "\n" . '# ou juste';
     $article = $article . "\n" . 'sy braincrafted:bootstrap:install';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 6 : Installer jpegoptim';
     $article = $article . "\n" . '----------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'sudo apt-get install jpegoptim';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 7 : Créer le filtre jpegoptim pour assetic';
     $article = $article . "\n" . '-----------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Dans config.yml';
     $article = $article . "\n" . '```yml';
     $article = $article . "\n" . 'assetic:';
     $article = $article . "\n" . '    filters:';
     $article = $article . "\n" . '        jpegoptim:';
     $article = $article . "\n" . '            bin: /usr/bin/jpegoptim';
     $article = $article . "\n" . '            max: 70';
     $article = $article . "\n" . '    twig:';
     $article = $article . "\n" . '        functions:';
     $article = $article . "\n" . '            jpegoptim: ~';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Note :** On peut aussi utiliser http://knpbundles.com/liip/LiipImagineBundle, à approndir';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 8 : L\'utiliser';
     $article = $article . "\n" . '--------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```twig';
     $article = $article . "\n" . '<img src="{{ jpegoptim(\'@AcmeFooBundle/Resources/public/images/example.jpg\') }}" alt="Example"/>';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 9 : Lancer pour la production';
     $article = $article . "\n" . '----------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'sy assetic:dump --env=prod --no-debug;';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Sources :';
     $article = $article . "\n" . '---------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '1. (http://symfony.com/fr/doc/current/cookbook/assetic/asset_management.html)';
     $article = $article . "\n" . '2. (http://bootstrap.braincrafted.com/)';
     $article = $article . "\n" . '3. (http://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-symfony2/utiliser-assetic-pour-gerer-les-codes-css-et-js-de-votre-site)';
     $article = $article . "\n" . '4. (https://github.com/yui/yuicompressor/releases)';
     $article = $article . "\n" . '';
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $manager->persist($p1);
     $manager->flush();
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151204T12:00'));
     $p1->setPublish(true);
     $p1->setTitle("Installer et configurer fosuserbundle");
     $p1->setAbstract("Tout simplement indispensable pour gérer vos utilisateurs simplement, ce bundle gère la validation d'inscription par email, les droits, les groupes. Une fois l'override des formulaires, profiter pleinement de cette solution efficace pour gérer vos utilisateurs.");
     $article = 'Step 1: Download FOSUserBundle using composer';
     $article = $article . "\n" . '---------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'composer require friendsofsymfony/user-bundle "dev-master"';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 2: Enable the bundle';
     $article = $article . "\n" . '-------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'In the AppKernel.php';
     $article = $article . "\n" . '```php';
     $article = $article . "\n" . '<?php';
     $article = $article . "\n" . '// app/AppKernel.php';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'public function registerBundles()';
     $article = $article . "\n" . '{';
     $article = $article . "\n" . '    $bundles = array(';
     $article = $article . "\n" . '        // ...';
     $article = $article . "\n" . '        new FOS\\UserBundle\\FOSUserBundle(),';
     $article = $article . "\n" . '    );';
     $article = $article . "\n" . '}';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 3: Create your User class';
     $article = $article . "\n" . '------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Créer le dossier src/Pm/UserBundle puis le fichier PmUserBundle.php';
     $article = $article . "\n" . '```php';
     $article = $article . "\n" . '<?php';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'namespace Pm\\UserBundle;';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'use Symfony\\Component\\HttpKernel\\Bundle\\Bundle;';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'class PmUserBundle extends Bundle';
     $article = $article . "\n" . '{';
     $article = $article . "\n" . '    public function getParent() {';
     $article = $article . "\n" . '        return \'FOSUserBundle\';';
     $article = $article . "\n" . '    }';
     $article = $article . "\n" . '}';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Puis le fichier src/Pm/UserBundle/Entity/User.php';
     $article = $article . "\n" . '```php';
     $article = $article . "\n" . '<?php';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'namespace Pm\\UserBundle\\Entity;';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'use FOS\\UserBundle\\Model\\User as BaseUser;';
     $article = $article . "\n" . 'use Doctrine\\ORM\\Mapping as ORM;';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '/**';
     $article = $article . "\n" . ' * @ORM\\Entity';
     $article = $article . "\n" . ' * @ORM\\Table(name="`user`")';
     $article = $article . "\n" . ' */';
     $article = $article . "\n" . 'class User extends BaseUser';
     $article = $article . "\n" . '{';
     $article = $article . "\n" . '    /**';
     $article = $article . "\n" . '     * @ORM\\Id';
     $article = $article . "\n" . '     * @ORM\\Column(type="integer")';
     $article = $article . "\n" . '     * @ORM\\GeneratedValue(strategy="AUTO")';
     $article = $article . "\n" . '     */';
     $article = $article . "\n" . '    protected $id;';
     $article = $article . "\n" . '}';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 4: Configure your application\'s security.yml';
     $article = $article . "\n" . '-------------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```yml';
     $article = $article . "\n" . '# app/config/security.yml';
     $article = $article . "\n" . 'security:';
     $article = $article . "\n" . '    encoders:';
     $article = $article . "\n" . '        FOS\\UserBundle\\Model\\UserInterface: bcrypt';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '    role_hierarchy:';
     $article = $article . "\n" . '        ROLE_ADMIN:       ROLE_USER';
     $article = $article . "\n" . '        ROLE_SUPER_ADMIN: ROLE_ADMIN';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '    providers:';
     $article = $article . "\n" . '        fos_userbundle:';
     $article = $article . "\n" . '            id: fos_user.user_provider.username';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '    firewalls:';
     $article = $article . "\n" . '        main:';
     $article = $article . "\n" . '            pattern: ^/';
     $article = $article . "\n" . '            form_login:'******'                provider: fos_userbundle';
     $article = $article . "\n" . '                csrf_provider: security.csrf.token_manager';
     $article = $article . "\n" . '                login_path: fos_user_security_login';
     $article = $article . "\n" . '                check_path: fos_user_security_check';
     $article = $article . "\n" . '                default_target_path: blog';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '            logout:';
     $article = $article . "\n" . '                path: fos_user_security_logout';
     $article = $article . "\n" . '                target: blog';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '            anonymous:    true';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '    access_control:';
     $article = $article . "\n" . '        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }';
     $article = $article . "\n" . '        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }';
     $article = $article . "\n" . '        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }';
     $article = $article . "\n" . '        - { path: ^/admin/, role: ROLE_ADMIN }';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 5: Configure the FOSUserBundle';
     $article = $article . "\n" . '-----------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Dans app/config/config.yml';
     $article = $article . "\n" . '```yml';
     $article = $article . "\n" . 'fos_user:'******'    db_driver: orm';
     $article = $article . "\n" . '    firewall_name: main';
     $article = $article . "\n" . '    user_class: AppBundle\\Entity\\User';
     $article = $article . "\n" . '    registration:';
     $article = $article . "\n" . '        confirmation:';
     $article = $article . "\n" . '            enabled: true';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 6: Import FOSUserBundle routing files';
     $article = $article . "\n" . '------------------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Dans app/config/routing.yml';
     $article = $article . "\n" . '```yml';
     $article = $article . "\n" . 'fos_user:'******'    resource: "@FOSUserBundle/Resources/config/routing/all.xml"';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 7: Update your database schema';
     $article = $article . "\n" . '-----------------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'sy doctrine:schema:update --force';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Step 8: Override twig files';
     $article = $article . "\n" . '---------------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '- Copy the folder vendor/frien.../Resources/views in app/Resources/FOSUserbundle/Resources';
     $article = $article . "\n" . '- Customize as you want';
     $article = $article . "\n" . '- do not forget to clear the dev cache after customizing';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Sources';
     $article = $article . "\n" . '-------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '1. https://github.com/FriendsOfSymfony/FOSUserBundle';
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $manager->persist($p1);
     $manager->flush();
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151205T12:00'));
     $p1->setPublish(true);
     $p1->setTitle("Installer et configurer corespherebundle");
     $p1->setAbstract("Ce bundle permet d'accéder à la console directement dans le navigateur, plus que pratique quand on est en production ! Il vous permettra de créer votre base de donnée, y loader vos fixtures et toute les commandes que vous aurez créer vous même !");
     $article = "Installer les sources";
     $article = $article . "\n" . '---------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Executer la commande suivante :';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'composer require coresphere/console-bundle "dev-master"';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Ajout de la route';
     $article = $article . "\n" . '-----------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Dans app/config/routing_dev.yml';
     $article = $article . "\n" . '```yml';
     $article = $article . "\n" . 'coresphere_console:';
     $article = $article . "\n" . '    resource: .';
     $article = $article . "\n" . '    type: extra';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Enregistrer le bundle';
     $article = $article . "\n" . '-------------------';
     $article = $article . "\n" . '```php';
     $article = $article . "\n" . 'public function registerBundles()';
     $article = $article . "\n" . '{';
     $article = $article . "\n" . '    $bundles = array(';
     $article = $article . "\n" . '        // other bundles here...';
     $article = $article . "\n" . '    );';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '    if (in_array($this->getEnvironment(), array(\'dev\', \'test\'))) {';
     $article = $article . "\n" . '        // ...';
     $article = $article . "\n" . '        $bundles[] = new CoreSphere\\ConsoleBundle\\CoreSphereConsoleBundle();';
     $article = $article . "\n" . '    }';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '    return $bundles;';
     $article = $article . "\n" . '}';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Installer les assets';
     $article = $article . "\n" . '--------------------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Executer la commande suivante :';
     $article = $article . "\n" . '```bash';
     $article = $article . "\n" . 'sy assets:install --symlink';
     $article = $article . "\n" . '```';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Sources';
     $article = $article . "\n" . '-------';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '1. https://github.com/CoreSphere/ConsoleBundle';
     $article = $article . "\n" . '2. http://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-symfony2/utiliser-la-console-directement-depuis-le-navigateur';
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $manager->persist($p1);
     $manager->flush();
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151221T12:00'));
     $p1->setPublish(true);
     $p1->setTitle("Calcul d'un MDD et d'un MDI");
     $p1->setAbstract("Cet article vous donne toute les formules utiles au calcul d'un mdd/mdi et les applique à un exemple.");
     $article = "# Examen de robotique Industrielle";
     $article = $article . "\n" . '';
     $article = $article . "\n" . '## I. Calcul du MDD';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '### 1. Calcul de la jacobienne préférentielle';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '#### (a) Calcul de p, i, j';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '- n = nombre de liason';
     $article = $article . "\n" . '- p = partie entière (n / 2)';
     $article = $article . "\n" . '- i = p + 1';
     $article = $article . "\n" . '- j = p';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '#### (b) Calcul des $z_{k(j)}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Formule :** $z_{k(j)} = R_{kj}.O_kO_j(j)$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '- $z_{1(2)} = R_{12}.\\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '- $z_{2(2)} = R_{22}.\\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '- $z_{3(2)} = R_{32}.\\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '- $z_{4(2)} = R_{42}.\\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '- $z_{5(2)} = R_{52}.\\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{12} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c2 & -s2 & 0 \\\\';
     $article = $article . "\n" . '  s2 & c2  & 0 \\\\';
     $article = $article . "\n" . '  0  & 0   & 1';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{22} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  1 & 0 & 0\\\\';
     $article = $article . "\n" . '  0 & 1 & 0\\\\';
     $article = $article . "\n" . '  0 & 0 & 1';
     $article = $article . "\n" . '\\end{pmatrix} \\rightarrow$ pas de rotation';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{32} = R_{23}^{-1} = R_{23}^T =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  1 & 0 & 0\\\\';
     $article = $article . "\n" . '  0 & 0 & -1\\\\';
     $article = $article . "\n" . '  0 & 1 & 0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{42} = R_{43}.R_{32} = R_{34}^T.R_{32} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c4 & 0  & s4\\\\';
     $article = $article . "\n" . '  s4 & 0  & c4\\\\';
     $article = $article . "\n" . '  0  & -1 & 0';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  1 & 0 & 0\\\\';
     $article = $article . "\n" . '  0 & 0 & -1\\\\';
     $article = $article . "\n" . '  0 & 1 & 0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{42} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c4 & s4 & 0\\\\';
     $article = $article . "\n" . '  s4 & c4 & 0\\\\';
     $article = $article . "\n" . '  0  & 0  & 1';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{52} = R_{54}.R_{43} = R_{45}^T.R_{42} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c5  & 0 & -s5\\\\';
     $article = $article . "\n" . '  -s5 & 0 & -c5\\\\';
     $article = $article . "\n" . '  0   & 1 & 0';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c4 & s4 & 0\\\\';
     $article = $article . "\n" . '  s4 & c4 & 0\\\\';
     $article = $article . "\n" . '  0  & 0  & 1';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{52} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c4.c5  & c5.s4 & -s5\\\\';
     $article = $article . "\n" . '  -c4.s5 & -s4.s5 & -c5\\\\';
     $article = $article . "\n" . '  s4 & c4 & 0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{1(2)} = \\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{2(2)} = \\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{3(2)} = \\begin{pmatrix}0 & 0 & 0\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{4(2)} = \\begin{pmatrix}0 & 0 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{5(2)} = \\begin{pmatrix}-s5 & -c5 & 1\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '#### (c) Calcul des $p_{ki(j)}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Formule :** $p_{ki(j)} = O_kO_i(j)$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$O_1O_3(2) = O_1O_2(2) + O_2O_3(2) = 0 + \\begin{pmatrix}0 & q3 & 0\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$O_2O_3(2) = \\begin{pmatrix}0 & q3 & 0\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$O_3O_3(2) = \\begin{pmatrix}0 & 0 & 0\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$O_4O_3(2) = \\begin{pmatrix}0 & 0 & 0\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$O_5O_3(2) = \\begin{pmatrix}0 & 0 & 0\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '#### (d) Calcul des $z_{k(j)} \\land p_{ki(j)}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Formule :**';
     $article = $article . "\n" . '$\\begin{pmatrix}a \\\\ b \\\\ c\\end{pmatrix} \\land \\begin{pmatrix}d \\\\ e \\\\ f\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  b.f - c.e\\\\';
     $article = $article . "\n" . '  c.d - a.f\\\\';
     $article = $article . "\n" . '  a.e - b.d';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{1(2)} \\land p_{13(2)} = \\begin{pmatrix}0 \\\\ 0 \\\\ 1\\end{pmatrix} \\land \\begin{pmatrix}0 \\\\ q3 \\\\ 0\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  -q3\\\\';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{2(2)} \\land p_{23(2)} = \\begin{pmatrix}0 \\\\ 0 \\\\ 1\\end{pmatrix} \\land \\begin{pmatrix}0 \\\\ q3 \\\\ 0\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  -q3\\\\';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{3(2)} \\land p_{33(2)} = \\begin{pmatrix}0 \\\\ 0 \\\\ 0\\end{pmatrix} \\land \\begin{pmatrix}0 \\\\ 0 \\\\ 0\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{4(2)} \\land p_{43(2)} = \\begin{pmatrix}0 \\\\ 0 \\\\ 1\\end{pmatrix} \\land \\begin{pmatrix}0 \\\\ 0 \\\\ 0\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$z_{5(2)} \\land p_{53(2)} = \\begin{pmatrix}-s5 \\\\ -c5 \\\\ 1\\end{pmatrix} \\land \\begin{pmatrix}0 \\\\ 0 \\\\ 0\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0\\\\';
     $article = $article . "\n" . '  0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '#### Ecriture de la jacobienne préférentielle';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Formule :**';
     $article = $article . "\n" . '$$';
     $article = $article . "\n" . 'J_{i(j)} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  \\sigma_1.z_1 + \\bar{\\sigma_1}.z_{1(j)}\\land p_{1i(j)} & \\dots & \\sigma_n.z_{n(j)} + \\bar{\\sigma_{n(j)}}.z_{n(j)}\\land p_{ni(j)} \\\\';
     $article = $article . "\n" . '  \\bar{\\sigma_1}.z_{1(j)} & \\dots & \\bar{\\sigma_n}.z_{n(j)}';
     $article = $article . "\n" . '\\end{pmatrix}';
     $article = $article . "\n" . '$$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'Simplification avec connaissance de la nature des liaisons';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$$';
     $article = $article . "\n" . '\\begin{align}';
     $article = $article . "\n" . '  J_{3(2)} &= ';
     $article = $article . "\n" . '  \\begin{pmatrix}';
     $article = $article . "\n" . '    z_{1(2)}\\land p_{13(2)} & z_{2(2)}\\land p_{23(2)} & z_{3(2)} & z_{4(2)}\\land p_{43(2)} & z_{5(2)}\\land p_{53(2)}\\\\';
     $article = $article . "\n" . '    z_{1(2)} & z_{2(2)} & O_{3\\times1} & z_{4(2)} & z_{5(2)}';
     $article = $article . "\n" . '  \\end{pmatrix}\\\\';
     $article = $article . "\n" . '  &=';
     $article = $article . "\n" . '  \\begin{pmatrix}';
     $article = $article . "\n" . '    -q3 & -q3 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '      0 &   0 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '      0 &   0 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '      0 &   0 & 0 & 0 & -s5\\\\';
     $article = $article . "\n" . '      0 &   0 & 0 & 0 & -c5\\\\';
     $article = $article . "\n" . '      1 &   1 & 0 & 1 & 1';
     $article = $article . "\n" . '  \\end{pmatrix}';
     $article = $article . "\n" . '\\end{align}';
     $article = $article . "\n" . '$$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '### 2. Calcul de $\\hat{P}_{in(j)}$ selon le vecteur $p_{in(j)}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Formule :** $\\hat{P}_{in(j)} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  0  & -z & y\\\\';
     $article = $article . "\n" . '  z  &  0 & -x\\\\';
     $article = $article . "\n" . '  -y &  x & 0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . 'avec $p_{in(j)} = \\begin{pmatrix}x & y & z\\end{pmatrix}^T$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$p_{35(2)} = \\begin{pmatrix}0\\\\0\\\\0\\end{pmatrix}$ donc $\\hat{P}_{in(j)} = O_{3\\times3}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '### 3. Calcul de $dp_{(0)}$ et $d\\varphi_{(0)}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '**Formule :**';
     $article = $article . "\n" . '$\\begin{pmatrix}dp_{(0)} \\\\ d\\varphi_{(0)}\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  R_{03} & O_{33}\\\\';
     $article = $article . "\n" . '  O_{33} & R_{03}';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  I_{33} & -\\hat{P}_{in(j)}\\\\';
     $article = $article . "\n" . '  O_{33} & I_{33}';
     $article = $article . "\n" . '\\end{pmatrix}.J_{3(2)}.dq$';
     $article = $article . "\n" . 'avec';
     $article = $article . "\n" . '$dq = \\begin{pmatrix}dq1 \\\\ \\vdots \\\\ dqn\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . 'or $\\hat{P}_{in(j)} = O_{3\\times3}$ donc';
     $article = $article . "\n" . '$\\begin{pmatrix}dp_{(0)} \\\\ d\\varphi_{(0)}\\end{pmatrix} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  R_{03} & O_{33}\\\\';
     $article = $article . "\n" . '  O_{33} & R_{03}';
     $article = $article . "\n" . '\\end{pmatrix}.J_{3(2)}.dq$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$R_{03} = R_{12}.R_{23}.R_{34} =';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  1 & 0 & 0\\\\';
     $article = $article . "\n" . '  0 & 1 & 0\\\\';
     $article = $article . "\n" . '  0 & 0 & 1';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c2 & -s2 & 0 \\\\';
     $article = $article . "\n" . '  s2 &  c2 & 0 \\\\';
     $article = $article . "\n" . '  0  &   0 & 1';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  1 &  0 & 0\\\\';
     $article = $article . "\n" . '  0 &  0 & 1\\\\';
     $article = $article . "\n" . '  0 & -1 & 0';
     $article = $article . "\n" . '\\end{pmatrix} = ';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c2 &  0 & -s2\\\\';
     $article = $article . "\n" . '  s2 &  0 &  c2\\\\';
     $article = $article . "\n" . '   0 & -1 &   0';
     $article = $article . "\n" . '\\end{pmatrix}$';
     $article = $article . "\n" . '';
     $article = $article . "\n" . '$$';
     $article = $article . "\n" . '\\begin{align}';
     $article = $article . "\n" . '\\begin{pmatrix}dp_{(0)} \\\\ d\\varphi_{(0)}\\end{pmatrix} &=';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  c2 &  0 & -s2 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '  s2 &  0 &  c2 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '   0 & -1 &   0 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '  0 & 0 & 0 & c2 &  0 & -s2\\\\';
     $article = $article . "\n" . '  0 & 0 & 0 & s2 &  0 &  c2\\\\';
     $article = $article . "\n" . '  0 & 0 & 0 &  0 & -1 &   0';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  -q3 & -q3 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '    0 &   0 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '    0 &   0 & 0 & 0 & 0\\\\';
     $article = $article . "\n" . '    0 &   0 & 0 & 0 & -s5\\\\';
     $article = $article . "\n" . '    0 &   0 & 0 & 0 & -c5\\\\';
     $article = $article . "\n" . '    1 &   1 & 0 & 1 & 1';
     $article = $article . "\n" . '\\end{pmatrix}.';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '  dq1\\\\ dq2\\\\ dq3\\\\ dq4\\\\ dq5';
     $article = $article . "\n" . '\\end{pmatrix}\\\\';
     $article = $article . "\n" . '&=';
     $article = $article . "\n" . '\\begin{pmatrix}';
     $article = $article . "\n" . '                       - c2.dq1.q3 - c2.dq2.q3\\\\';
     $article = $article . "\n" . '                       - dq1.q3.s2 - dq2.q3.s2\\\\';
     $article = $article . "\n" . '                                             0\\\\';
     $article = $article . "\n" . ' - dq1.s2 - dq2.s2 - dq4.s2 - dq5.(s2 + c2.s5)\\\\';
     $article = $article . "\n" . '   c2.dq1 + c2.dq2 + c2.dq4 + dq5.(c2 - s2.s5)\\\\';
     $article = $article . "\n" . '                                        c5.dq5';
     $article = $article . "\n" . '\\end{pmatrix}';
     $article = $article . "\n" . '\\end{align}';
     $article = $article . "\n" . '$$';
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $p1->setMathematics(true);
     $manager->persist($p1);
     $manager->flush();
 }
コード例 #22
0
 public function getExamplePostEntity()
 {
     $post = new Post();
     $post->setTitle('Eros diam egestas libero eu vulputate risus');
     $post->setSlug('eros-diam-egestas-libero-eu-vulputate-risus');
     $post->setSummary('Sed varius a risus eget aliquam Pellentesque et sapien pulvinar consectetur In
         hac habitasse platea dictumst Urna nisl sollicitudin id varius orci quam id turpis Ut eleifend mauris
         et risus ultrices egestas Aliquam sodales odio id eleifend tristique Ut suscipit posuere justo at
         vulputate');
     $post->setContent('Lorem ipsum dolor sit amet consectetur adipisicing elit, sed do eiusmod tempor
         incididunt ut labore et **dolore magna aliqua**: Duis aute irure dolor in
         reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
         Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
         deserunt mollit anim id est laborum.');
     $post->setAuthorEmail('*****@*****.**');
     $this->entityManager->persist($post);
     $this->entityManager->flush();
     return $post;
 }