/** * run() should reset the character state */ public function testRun_incrementsParagraphIndex() { $style = new \Jstewmc\Rtf\Style(); $old = $style->getCharacter()->getIsBold(); $style->getCharacter()->setIsBold(!$old); $element = new Plain(); $element->setStyle($style); $element->run(); $new = $style->getCharacter()->getIsBold(); $this->assertEquals($old, $new); return; }
public function input(array $options) { $label = !empty($options['name']) ? ucwords($options['name']) : ''; return '<div class="form-group row"> ' . (empty($label) | substr($label, 0, 1) == '_' ? '' : '<label class="col-md-4 control-label text-right">' . $label . '</label>') . '<div class="col-md-6">' . parent::plainInput(array_merge(['class' => 'form-control'], $options)) . '</div> </div>'; }
/** * * @param Spot_Mapper_Abstract $mapper * @param mixed $identifierCol * @param mixed $credentialCol * @param mixed $saltCol * @return Application_Classes_Auth_Adapter_Spot */ public function __construct(\Spot\Mapper $mapper, $entityName, $identifierCol, $credentialCol, $saltCol) { parent::__construct($mapper, $entityName, $identifierCol, $credentialCol); if (!$mapper->fieldExists($entityName, $saltCol)) { throw new \Saros\Auth\Exception("Salt column of '" . $saltCol . "' is not defined in entity."); } $this->saltCol = $saltCol; }
/** * Get the html node for this element * * @param \DOMElement $node * @param \AppShed\Remote\XML\DOMDocument $xml * @param \AppShed\Remote\HTML\Settings $settings */ protected function getHTMLNodeInner($node, $xml, $settings) { if ($this->image) { $imageDiv = $xml->createElement('div', ['class' => 'image-container']); $node->appendChild($imageDiv); $imageDiv->appendChild($xml->createImgElement($this->image->getUrl(), 'image', $this->image->getSize())); } parent::getHTMLNodeInner($node, $xml, $settings); }
/** * Generate an input area. * * @param array $options * * @return string */ public function input(array $options) { $label = !empty($options['name']) ? ucwords($options['name']) : ''; return ' <div class="input-field"> ' . parent::plainInput(array_merge(['class' => 'validate', 'id' => $this->genId($label)], $options)) . (empty($label) | substr($label, 0, 1) == '_' ? '' : '<label for="' . $this->genId($label) . '">' . $this->inputToRead($label) . '</label>') . ' </div> '; }
Log::out('try to get a property from simple1'); Log::out('var = ' . $simple1->var); Log::out('try to get a property from simple3'); Log::out('myvar1 = ' . $simple3->myvar1); Log::out('temp = ' . $simple3->temp); Log::out('humidity = ' . $simple3->humidity); //the following will fail //Log::out('myvar1 = '.$simple3->myvar2); // Let's put it in a non-factory object class Plain { public $friend; public function __construct() { } public function setFriend($name) { $this->friend = Factory::getObject($name); } public function outFriendName() { if ($this->friend) { Log::out('Friend\'s name ' . $this->friend->getName()); } } } $plain = new Plain(); $plain->setFriend('jesse'); $plain->outFriendName(); $friend = $plain->friend; $friend->outStats();