Layer-controlled two-dimensional perovskites: synthesis and optoelectronics