-
-
Save dmitrybelyakov/9369957 to your computer and use it in GitHub Desktop.
Revisions
-
dmitrybelyakov created this gist
Mar 5, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ /** * Construct * Instantiates the form and configures input fields * * @return void */ public function __construct($name, array $options = array()) { //init parent::__construct($name, $options); $this->add(new Element\Csrf('csrf')); /* * Meta elements */ $meta = new FieldSet('Meta'); //title $title = new Element\Text('title'); $title->setLabel('Title'); $meta->add($title); //slug $slug = new Element\Text('slug'); $slug->setLabel('Slug'); $meta->add($slug); //meta description $metaDescription = new Element\Textarea('metaDescription'); $metaDescription->setLabel('Meta description'); $meta->add($metaDescription); //meta keywords $metaKeywords = new Element\Text('metaKeywords'); $metaKeywords->setLabel('Meta keywords'); $meta->add($metaKeywords); //add meta $meta->setAttributes(array('legend' => 'Custom metadata')); $this->add($meta); /* * Templates */ $templates = new FieldSet('Templates'); $templateNames = array('' => 'Inherited'); foreach($this->templates as $template) $templateNames[$template] = $template; //layout $layout = new Element\Select('layout'); $layout->setLabel('Layout template'); $layout->setValueOptions($templateNames); $templates->add($layout); //add templates $templates->setAttributes(array('legend' => 'Templates')); $this->add($templates); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ Array ( [id] => 11 [locale] => en_US [status] => published [path] => /11 [title] => Some example structure node [slug] => with-alias [layout] => layout/layout [metaDescription] => Some example structure node [metaKeywords] => Some example structure node )