We propose a new unified model that describes~dark energy and dark matter in the context of $f(R,phi )$ gravity using a massive scalar field in five dimensions. The scalar field is considered in the bulk that surrounds the 3-brane in branworld model. We show that for a specific choice of the $% f(R,phi )$ function, we can describe the Einstein gravitation in 4-dimensional space-time. We obtain a relationship between the speed of the universes expansion and the speed of the bulks expansion. We also propose that the dark matter is represented by the scalar field mass and that the dark energy is a kinetic energy of this field. Finally, we show that, according to conditions, one can obtain the percentages of density of dark matter and the density of ordinary matter.