Salim narrates from his father, Sayyiduna Abdullah bin Umar (may Allah be pleased with them both), that the Messenger of Allah (peace and blessings be upon him) said: "Do not make the mosques as pathways; they are only for the remembrance of Allah or for prayer."
Hadith Referenceسلسله احاديث صحيحه / الاذان و الصلاة / 598