During the pendency of any proceeding for dissolution of marriage or for legal separation of the parties or under Division 8 (commencing with Section 3000) (custody of children) or in any proceeding where there is at issue the support of a minor child or a child for whom support is authorized under Section 3901 or 3910, the court may order (a) either spouse to pay any amount that is necessary for the support of the other spouse, consistent with the requirements of subdivisions (i) and (m) of Section 4320 and Section 4325, or (b) either or both parents to pay any amount necessary for the support of the child, as the case may be.