We describe a model that is being used in some Spanish universities for future secondary mathematics teachers training. This model is based on a functional view of students' learning, of how didactic knowledge is established on the basis of teachers' activities, and of how we see some mathematics education notions as conceptual and methodological tools with didactic purposes. This view gives rise to a procedure, didactic analysis, as a conceptualization of the teacher's activities needed for planning, implementing and assessing mathematics lessons. We present the general curriculum design of a methods course based on these ideas and procedures and mention some research results concerning the design and implementation of such courses