put() public method

Resulting template will have access to ${$name$} variable.
public put ( string $name, mixed $value )
$name string
$value mixed
Exemplo n.º 1
0
 /**
  * Place useful objects into the initial context.
  *
  *
  * @param  Capsule   $context The context to populate, as retrieved from
  *                            {@link #initControlContext()}.
  * @return void
  * @throws Exception Error while populating context.  The {@link
  *                           #main()} method will catch and rethrow as a
  *                           <code>BuildException</code>.
  */
 protected function populateInitialContext(Capsule $context)
 {
     $this->context->put("now", strftime("%c", time()));
     $this->context->put("task", $this);
 }
 /**
  * Adds the propel.xxx properties to the passed Capsule context, changing names to just xxx.
  *
  * Also, move xxx.yyy properties to xxxYyy as PHP doesn't like the xxx.yyy syntax.
  *
  * @param Capsule $context
  * @see getPropelProperties()
  */
 public function populateContextProperties(Capsule $context)
 {
     foreach ($this->getPropelProperties() as $key => $propValue) {
         $this->log('Adding property ${' . $key . '} to context', PROJECT_MSG_DEBUG);
         $context->put($key, $propValue);
     }
 }
 /**
  * Adds the propel build properties to the passed Capsule context.
  *
  * @param      Capsule $context
  * @see        GeneratorConfig::getBuildProperties()
  */
 public function populateContextProperties(Capsule $context)
 {
     foreach ($this->getGeneratorConfig()->getBuildProperties() as $key => $propValue) {
         $this->log('Adding property ${' . $key . '} to context', Project::MSG_DEBUG);
         $context->put($key, $propValue);
     }
 }