Recess Developer Forums: Plugins & Extensibility - Recess Developer Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Plugins & Extensibility How to integrate vendor code with Recess?

#1 User is offline   Christine Fürst Icon

  • Group: Members
  • Posts: 11
  • Joined: 17-October 09
  • LocationRotterdam

Posted 04 December 2009 - 04:00 AM

HOI. recess developers,

Is there anyone who knows a guide for integration of vendor code (libraries) such as Zend or Swift mailer with Recess.

The book of recess chapter 14 does not tell yet.

http://www.recessfra.../html/ch14.html

I would like to know the most convenient way to do this.

Should I put Zend and Swift mailer into the plugins directory?

Let me know if you know.

Thanks a lot already.

I'm looking forward to your reply.

Cheers, Stinie
0

#2 User is offline   beline Icon

  • Group: Members
  • Posts: 36
  • Joined: 02-September 09
  • LocationMaine, USA

Posted 08 December 2009 - 01:55 PM

I have plugged PHPMailer 5.0.0 if your interested...
0

#3 User is offline   beline Icon

  • Group: Members
  • Posts: 36
  • Joined: 02-September 09
  • LocationMaine, USA

Posted 08 December 2009 - 02:35 PM

Here it is. PHPMailer plugged for Recess. To use it simply extract it and put the contents into the plug-ins folder (meaning, the folder thebeline), and include it in the application class. Here is an example:

<?php
Library::import('recess.framework.Application');
Library::import('thebeline.PHPMailer.PHPMailerPlugin');  // Here

class ExampleApplication extends Application {
    public function __construct() {
        
        $this->name = 'Example Application';
        
        $this->viewsDir = $_ENV['dir.apps'] . 'exampleapp/views/';
        
        $this->assetUrl = $_ENV['url.assetbase'] . 'apps/exampleapp/public/';
        
        $this->modelsPrefix = 'exampleapp.models.';
        
        $this->controllersPrefix = 'exampleapp.controllers.';
        
        $this->routingPrefix = 'exampleapp/';
        
        $this->plugins = array(new PHPMailerPlugin());  // And here
        
    }
}
?>


And use it just like you normally would.

Attached File(s)


0

#4 User is offline   Christine Fürst Icon

  • Group: Members
  • Posts: 11
  • Joined: 17-October 09
  • LocationRotterdam

Posted 20 December 2009 - 07:03 AM

View Postbeline, on 08 December 2009 - 07:55 PM, said:

I have plugged PHPMailer 5.0.0 if your interested...


HOI. Beline,

Thanks a lot. I'll have look at it right now.

:) Stinie
0

#5 User is offline   Christine Fürst Icon

  • Group: Members
  • Posts: 11
  • Joined: 17-October 09
  • LocationRotterdam

Posted 20 December 2009 - 09:31 AM

View Postbeline, on 08 December 2009 - 08:35 PM, said:

Here it is. PHPMailer plugged for Recess. To use it simply extract it and put the contents into the plug-ins folder (meaning, the folder thebeline), and include it in the application class. Here is an example:

<?php
Library::import('recess.framework.Application');
Library::import('thebeline.PHPMailer.PHPMailerPlugin');  // Here

class ExampleApplication extends Application {
    public function __construct() {
        
        $this->name = 'Example Application';
        
        $this->viewsDir = $_ENV['dir.apps'] . 'exampleapp/views/';
        
        $this->assetUrl = $_ENV['url.assetbase'] . 'apps/exampleapp/public/';
        
        $this->modelsPrefix = 'exampleapp.models.';
        
        $this->controllersPrefix = 'exampleapp.controllers.';
        
        $this->routingPrefix = 'exampleapp/';
        
        $this->plugins = array(new PHPMailerPlugin());  // And here
        
    }
}
?>


And use it just like you normally would.


HOI. beline,

Thanks al lot for sharing!

I'll use your plugin in the meantime.

I'll try to learn from it.


Cheers, Stinie
0

#6 User is offline   KevBurnsJr Icon

  • Icon
  • Group: Administrators
  • Posts: 86
  • Joined: 25-August 09
  • LocationSilicon Valley, CA

Posted 30 January 2010 - 03:53 PM

Hey beline, this is great.

You should throw it on github.

I've been using the naming convention recess-plugin_[plugin-name] for Recess plugin repositories.
Less Talk, More Code.
0

#7 User is offline   Tamas Jozsa Icon

  • Group: Members
  • Posts: 2
  • Joined: 20-March 10

Posted 27 March 2010 - 04:47 AM

View Postbeline, on 08 December 2009 - 08:35 PM, said:

Here it is. PHPMailer plugged for Recess. To use it simply extract it and put the contents into the plug-ins folder (meaning, the folder thebeline), and include it in the application class. Here is an example:

<?php
Library::import('recess.framework.Application');
Library::import('thebeline.PHPMailer.PHPMailerPlugin');  // Here

class ExampleApplication extends Application {
    public function __construct() {
        
        $this->name = 'Example Application';
        
        $this->viewsDir = $_ENV['dir.apps'] . 'exampleapp/views/';
        
        $this->assetUrl = $_ENV['url.assetbase'] . 'apps/exampleapp/public/';
        
        $this->modelsPrefix = 'exampleapp.models.';
        
        $this->controllersPrefix = 'exampleapp.controllers.';
        
        $this->routingPrefix = 'exampleapp/';
        
        $this->plugins = array(new PHPMailerPlugin());  // And here
        
    }
}
?>


And use it just like you normally would.


Hi,

Thanks for sharing.

But am missing an important point. How to use a plugin in Recess? I have the plugin up in the directory, and also added the needed stuf to the application class.

But have no clue how to import it into the controller class. If I just try:

        /** !Route GET, send */
	function send(){
		//send test email
		$mailer = new PHPMailer();
		// Set the subject
		$mailer->Subject = 'This is a test';

		// Body
		$mailer->Body = 'This is a test of my mail system!';

		// Add an address to send to.
		$mailer->AddAddress('my@email.com', 'Name Name');

		if(!$mailer->Send())
		{
			echo 'There was a problem sending this mail!';
		}
		else
		{
			echo 'Mail sent!';
		}

	}


I get a Recess error:

PHPMailer has not been imported.

139:
140:    /** !Route GET, send */
141:    function send(){
142:        //send test email
143:        $mailer = new PHPMailer();
144:        // Set the subject
145:        $mailer->Subject = 'This is a test';
146:
147:        // Body
148:        $mailer->Body = 'This is a test of my mail system!';


May I ask you to help?

Thanks,
Regards,
Tamas
1

#8 User is offline   Christine Fürst Icon

  • Group: Members
  • Posts: 11
  • Joined: 17-October 09
  • LocationRotterdam

Posted 08 May 2010 - 03:10 AM

Thanks for pointing out the usage!

This is valuable to me.

I returned to Recess after trying other frameworks.

Recess feels the most enjoyable.

Hopefully I get better in PHP programming so that I can understand more without tutorials.

Cheers, @stinie
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users