Cook pasta al dente in a large pot of salted water, according to package instructions. Save one cup of pasta water before draining pasta. Separately, in a large skillet over medium heat, add oil or vegetable broth and cook onion and garlic for 2-3 minutes. Add tomatoes, beans, and basil with red pepper flakes. If needed, add some pasta water to thin sauce. Heat sauce until hot and bubbly. Toss with pasta. Add salt and freshly ground pepper, to taste. Serve.
As a rule of thumb, use 3 to ½ the amount of dried herbs to the fresh herb amount. The older the dried herbs are the less potent they are. Rub the dried herb between your fingers to determine the strength of the aroma; if aroma is weak, use more of the herb.