public function create()
	{
		$class = __NAMESPACE__ . '\\Scaffolding\\' . ucfirst($this->type);

		if (class_exists($class))
		{
			$obj = new $class($this->output, $this->arguments);
		}
		else
		{
			if (empty($this->type))
			{
				$this->output->error('Error: Sorry, scaffolding can\'t create nothing/everything. Try telling it what you want to create.');
			}
			else
			{
				$this->output->error('Error: Sorry, scaffolding doesn\'t know how to create a ' . $this->type);
			}
		}

		// Get author name and email - we'll go ahaed and retrieve for all create calls
		$user_name  = Config::get('user_name');
		$user_email = Config::get('user_email');

		if (!$user_name || !$user_email)
		{
			$this->output
			     ->addSpacer()
			     ->addLine('You can specify your name and email via:')
			     ->addLine(
					'muse configuration set --user_name="John Doe"',
					array(
						'indentation' => '2',
						'color'       => 'blue'
					)
				)
				->addLine(
					'muse configuration set --user_email=john.doe@gmail.com',
					array(
						'indentation' => '2',
						'color'       => 'blue'
					)
				)
				->addSpacer()
				->error("Error: failed to retrieve author name and/or email.");
		}

		$obj->addReplacement('author_name', $user_name)
			->addReplacement('author_email', $user_email);

		// Call the construct method
		$obj->construct();
	}
public function create()
	{
		$class = __NAMESPACE__ . '\\Scaffolding\\' . ucfirst($this->type);

		if (class_exists($class))
		{
			$obj = new $class($this->output, $this->arguments);
		}
		else
		{
			if (empty($this->type))
			{
				$this->output->error('Error: Sorry, scaffolding can\'t create nothing/everything. Try telling it what you want to create.');
			}
			else
			{
				$this->output->error('Error: Sorry, scaffolding doesn\'t know how to create a ' . $this->type);
			}
		}

		// Get author name and email - we'll go ahaed and retrieve for all create calls
		$user_name  = Config::get('user_name');
		$user_email = Config::get('user_email');

		if (!$user_name || !$user_email)
		{
			$this->output
			     ->addSpacer()
			     ->addLine('You can specify your name and email via:')
			     ->addLine(
					'muse configuration set --user_name="John Doe"',
					array(
						'indentation' => '2',
						'color'       => 'blue'
					)
				)
				->addLine(
					'muse configuration set --user_email=john.doe@gmail.com',
					array(
						'indentation' => '2',
						'color'       => 'blue'
					)
				)
				->addSpacer()
				->error("Error: failed to retrieve author name and/or email.");
		}

		$obj->addReplacement('author_name', $user_name)
			->addReplacement('author_email', $user_email);

		// Call the construct method
		$obj->construct();
	}
public function create ( ) { $ class = __NAMESPACE__ . '\\Scaffolding\\' . ucfirst ( $ this -> type ) ; if ( class_exists ( $ class ) ) { $ obj = new $ class ( $ this -> output , $ this -> arguments ) ; } else { if ( empty ( $ this -> type ) ) { $ this -> output -> error ( 'Error: Sorry, scaffolding can\'t create nothing/everything. Try telling it what you want to create.' ) ; } else { $ this -> output -> error ( 'Error: Sorry, scaffolding doesn\'t know how to create a ' . $ this -> type ) ; } } // Get author name and email - we'll go ahaed and retrieve for all create calls $ user_name = Config :: get ( 'user_name' ) ; $ user_email = Config :: get ( 'user_email' ) ; if ( ! $ user_name || ! $ user_email ) { $ this -> output -> addSpacer ( ) -> addLine ( 'You can specify your name and email via:' ) -> addLine ( 'muse configuration set --user_name="John Doe"' , array ( 'indentation' => '2' , 'color' => 'blue' ) ) -> addLine ( 'muse configuration set --user_email=john.doe@gmail.com' , array ( 'indentation' => '2' , 'color' => 'blue' ) ) -> addSpacer ( ) -> error ( "Error: failed to retrieve author name and/or email." ) ; } $ obj -> addReplacement ( 'author_name' , $ user_name ) -> addReplacement ( 'author_email' , $ user_email ) ; // Call the construct method $ obj -> construct ( ) ; }
Create a new item from scaffolding templates

@return  void
Create a new item from scaffolding templates