Given the rapid growth of renewable energy generation, photovoltaic inverters have gained widespread adoption in power generation systems. To achieve improved precision in control and enhanced quality in the output waveform of the inverters, this article presents a single-phase photovoltaic inverter designed for both grid-connected and off-grid systems. It utilizes a quasi-proportional-resonant control technique. Initially, the mathematical representation of the grid-connected and off-grid inverter is established. Following this, the quasi-proportional resonant control strategy is introduced, with the corresponding implementation method of the controller derived from its equivalent block diagram. Furthermore, the control block diagrams of the grid-connected and off-grid inverters undergo a detailed analysis, and the system’s transfer function is obtained from the control block diagram. The incorporation of grid voltage feedforward control is introduced for examining the system’s tracking performance. Ultimately, the proposed control approach is validated for its effectiveness and practicality through Simulink simulation.