Enables a template, adding it to the generator.

 @param [Symbol, String] name
   The name of the template to add.

 @since 0.4.0
438227
def enable_template(name)
      name = name.to_sym

      return false if @enabled_templates.include?(name)

      unless (template_dir = Template.templates[name])
        say "Unknown template #{name}", :red
        exit -1
      end

      new_template = Template::Directory.new(template_dir)

      # mark the template as enabled
      @enabled_templates << name

      # enable any other templates
      new_template.enable.each do |sub_template|
        enable_template(sub_template)
      end

      # append the new template to the end of the list,
      # to override previously loaded templates
      @templates << new_template

      # add the template directory to the source-paths
      self.source_paths << new_template.path
      return true
    end
206127
public function enable($name)
    {
        if ($this->isEnabled($name)) {
            return;
        }

        $extension = $this->getExtension($name);

        $this->dispatcher->dispatch(new Enabling($extension));

        $enabled = $this->getEnabled();

        $enabled[] = $name;

        $this->migrate($extension);

        $this->publishAssets($extension);

        $this->setEnabled($enabled);

        $extension->enable($this->app);

        $this->dispatcher->dispatch(new Enabled($extension));
    }
1064431
public void addTemplate( String templateName, URLTemplate template )
    {
        if ( templateName == null || templateName.length() == 0 )
        {
            throw new IllegalArgumentException( "Template name cannot be null or empty." );
        }

        if ( template == null )
        {
            throw new IllegalArgumentException( "URLTemplate cannot be null." );
        }

        _templates.put( templateName, template );
    }
899258
static function enable(string $name) {
        if (!isset(self::$_captchaList[$name])) {
            Console::warning("Captcha generator \"$name\" do not exist.");
            return;
        }
        self::$_enableList = self::$_enableList + [$name];
    }
515374
public void addActivationName(String name)
    {
        if (sealed) onSealedMutation();
        if (activationNames == null)
            activationNames = new HashSet<String>();
        activationNames.add(name);
    }
1330415
def generate name, file
      require 'erb'
      template = File.read(File.join(File.dirname(__FILE__), "class_template.erb"))
      erb = ERB.new(template)
      code = erb.result(binding)
      Dir.mkdir(@basedir) unless File.directory?(@basedir)
      File.open(file, "w+") do |f|
        f.puts code
      end
    end
948257
def add_output(self, name, value):
        
        self.template.add_output(Output(name, Value=value))
760998
def build_template(template_path)
      # FIXME: this is called every time build_template is called.
      # although this is idepodent, it's got room for optimization
      self.build_components!

      ERB.new( File.open( template_path ).read, nil, '<>' ).result(self.binding)
    end
1211985
def load_template(self, name, *parameters):
        
        template, fields, header_fields = self._set_templates_fields_and_header_fields(name, parameters)
        self._init_new_message_stack(template, fields, header_fields)
578801
function(function_name) {

		for (var i = 0, count = this._current_templates.length; i < count; i++) {

			this._current_templates[i][function_name]();

		}

	}
30590
def create_config(name)

      name = ConfigurationList.symbol_config_name_to_config_name[name] if ConfigurationList.symbol_config_name_to_config_name[name]

      # @todo a configuration has additional fields that are ususally set with
      #   some target information for the title.

      new_config = @registry.add_object(Configuration.default_properties(name))
      @properties['buildConfigurations'] << new_config.identifier

      yield new_config if block_given?

      new_config.save!
    end
192876
public function addTemplatesFolder($name, $path)
    {
        if (is_dir($path)) {
            $this->templateEngine->addFolder($name, $path);
        }
    }
893793
def add_hook(name = nil, cascade = false, &hook)
    if name == nil or name == true or name == false
      cascade = name
      assign_self_hook(cascade, &hook)
    else
      assign_hook(name_to_a(name), cascade, &hook)
    end
  end
540479
def add_child(name)
      child = self.class.new(name, self)
      yield child if block_given?
      children << child
      child
    end
960777
def add_child(name, opts = {}, &block)
      delete_property(name)
      properties << ChildDeclaration.new(name, opts.delete(:class), opts, &block)
    end
864417
public function addTemplate($name, $type = self::TEMPLATE_START, $file) {
        if ($this->_enabled == true) {
            switch ($type) {
                case self::TEMPLATE_START:
                    $this->_template[$file]['name'] = $name;
                    $this->_template[$file]['time'] = microtime(true);
                    break;

                case self::TEMPLATE_END:
                    $this->_template[$file]['time'] = round((microtime(true) - $this->_template[$file]['time']) * 1000, 4);
                    break;
            }
        }
    }
512022
def add_message(message)
      @messages.key?(message.name) and raise SpecificationError,
        "A message named #{message.name} was already defined in #@protocol"
      @messages[message.name] = message
    end