Electro-optic and magneto-optic photonic devices based on multilayer photonic structures