user5985764
user5985764

Reputation:

Doctrine ORM default value with quotes

how can i set a default value with different quotes?

     /**
     * @ORM\Column(type="string", options={"default" = "<link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet">"})
     */

THX for help

Upvotes: 1

Views: 2058

Answers (2)

Angelo C
Angelo C

Reputation: 66

 /**
   * @ORM\Column(type="string")
   */
  protected $field = '<link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet">';

Upvotes: 0

Sergei Kutanov
Sergei Kutanov

Reputation: 825

regarding your question, to escape a quotation you need to double it. Here's a working version of your annotation.

@ORM\Column(type="string", options={"default": "<link href=""https://fonts.googleapis.com/css?family=Nunito+Sans"" rel=""stylesheet"">"})

Upvotes: 5

Related Questions