
120 Cal.App.3d 858 (1981)
175 Cal. Rptr. 64
HENRY M. FOGELSON, Plaintiff and Appellant,
v.
THE MUNICIPAL COURT FOR THE LOS ANGELES JUDICIAL DISTRICT OF LOS ANGELES COUNTY, Defendant and Respondent; THE PEOPLE, Real Party in Interest and Respondent.
Docket No. 57838.
Court of Appeals of California, Second District, Division Five.
June 24, 1981.
*859 COUNSEL
Barry A. Fisher, David Grosz and Stanley Fleishman for Plaintiff and Appellant.
No appearance for Defendant and Respondent.
Burt Pines, City Attorney, and Jerome Montgomery, Assistant City Attorney, for Real Party in Interest and Respondent.
OPINION
KAUS, P.J.
Petitioner and appellant Fogelson seeks a determination that section 1021.5 of the Code of Civil Procedure[1] may, in a proper *860 case, be used to pay the attorney's fees incurred by a defendant in a criminal action.[2] The People, as the real party in interest, contend that petitioner chose the wrong remedy to test the correctness of his legal submission with which, in any event, they do not agree.

FACTS
In 1974 petitioner was named as the defendant in two criminal complaints containing a total of three counts which were eventually consolidated for trial. He prevailed on two counts which are not material to this proceeding, but was convicted on a third count which charged a violation of section 42.14.1 of the Los Angeles Municipal Code relating to solicitation on city property. The conviction was reversed by the appellate department of the superior court, but another division of this court transferred the case to itself under rule 62(a) and eventually affirmed. The Supreme Court granted a hearing and reversed in a decision filed April 26, 1978  People v. Fogelson (1978) 21 Cal.3d 158 [145 Cal. Rptr. 542, 577 P.2d 677].
The municipal court dismissed the criminal proceeding on September 19, 1978. Petitioner then filed, in that court, a motion for attorney's fees and a memorandum of costs which included an item for $35,000 as a "reasonable and appropriate" attorney's fee. The municipal court denied the motion on November 1, 1978. Petitioner appealed to the appellate department. That court, however, dismissed the appeal on March 22, 1979, holding that the order denying the motion for attorney's fees was not appealable as an order after judgment affecting petitioner's substantial rights. (Pen. Code, § 1466, subd. 2(b).) Nevertheless, acting under rule 63, it certified the matter to this court. Transfer was, however, denied on March 29, 1979 by yet another division.
A little over two months later, on June 6, 1979, petitioner filed a petition for a "writ of mandate and/or certiorari" in the superior court. The purpose of the proceeding was to obtain a ruling that section 1021.5 could apply to criminal cases and to secure an order directing the municipal court to determine whether, in this particular case, the *861 statutory criteria of section 1021.5 were met. After a hearing the superior court denied relief relying solely on a point of procedure: petitioner had an adequate legal remedy, namely "the filing of a proper claim for fees and, if the claim is denied, ... the bringing of an ordinary civil action for the recovery of such fees." It is this particular denial which petitioner seeks to review by this appeal.

DISCUSSION
(1) Since we are quite convinced that the Legislature never intended section 1021.5 to apply to attorney's fees incurred in the defense of a criminal prosecution, we shall not waste any time on the question of procedure, except to note that we have serious doubts concerning the basis on which the superior court denied relief: if section 1021.5 were applicable it clearly provides for a motion  not a separate civil action  and just as clearly states that if the fees are sought against a public entity "no claim shall be required to be filed therefor."[3]
We turn to the merits: We have examined all available legislative materials and can assert with confidence that nothing so much as winks at the possibility that section 1021.5 might be applied to attorney's fees incurred in the defense of criminal cases. Nor have we found a single criminal case among those which apparently triggered the legislation. (E.g., Alyeska Pipeline Co. v. Wilderness Society (1975) 421 U.S. 240 [44 L.Ed.2d 141, 95 S.Ct. 1612]; D'Amico v. Board of Medical Examiners (1974) 11 Cal.3d 1, 24-27 [112 Cal. Rptr. 786, 520 P.2d 10].) Finally a case to which section 1021.5 is much indebted as far as its precise language is concerned  La Raza Unida v. Volpe (N.D.Cal. 1972) 57 F.R.D. 94  is, of course, a civil case.
In sum: nothing we have found supports petitioner on the basic question whether the Legislature intended section 1021.5 to apply to cases such as petitioner's. Petitioner emphasizes that there is nothing in section 1021.5 itself which expressly restricts its impact to civil actions: rather it speaks of "any action which has resulted in the enforcement of an important right affecting the public interest" and "actions" are described in section 24 of the Code of Civil Procedure as being either civil *862 or criminal.[4] Petitioner, however, overlooks that just seven sections further down, section 31 provides that "[t]he Penal Code defines and provides for the prosecution of a criminal action." While this is by no means conclusive on the issue whether the Penal Code provides for the payment of attorney's fees in certain cases, it does suggest that attorney fees provisions in the Code of Civil Procedure do not deal with criminal actions, unless the words or context compel a holding that they do.
Actually, of course, precisely the opposite is true. Section 1021.5 is part of title 14 of part 2 of the Code of Civil Procedure, which part is entitled "of Civil Actions." More specifically it is to be found in chapter 6 dealing with the subject of costs and appears as a qualification to section 1021 which provides that, generally, attorney's fees are each litigant's own concern.[5] Nothing could be clearer than that chapter 6 addresses only the question of costs and attorney's fees in civil actions. Were one to follow petitioner's suggestion and interpret the word "action" whenever it appears in chapter 6 to include criminal prosecutions, total chaos would result.[6]
In brief the context in which section 1021.5 appears would make it a highly imaginative exercise of judicial legislation to apply it to criminal cases. (See Bruce v. Gregory (1967) 65 Cal.2d 666, 674 [56 Cal. Rptr. 265, 423 P.2d 193]; County of Orange v. Cory (1979) 97 Cal. App.3d 760, 769 [159 Cal. Rptr. 78]; Steilberg v. Lackner (1977) 69 Cal. App.3d 780, 785 [138 Cal. Rptr. 378]; Johnstone v. Richardson (1951) 103 Cal. App.2d 41, 46 [229 P.2d 9].) The legislative intent being plain, we simply have no occasion to discuss the many considerations of public policy which petitioner advances in favor of legislation which would reimburse *863 his attorney. However desirable such legislation might be, section 1021.5 is not it.
Finally petitioner points out that the same result  invalidation of section 42.14.1 of the Los Angeles Municipal Code  could have been obtained in a civil action for an injunction or, more probably, for a declaratory judgment. (Cf., Zeitlin v. Arnebergh (1963) 59 Cal.2d 901, 905 [31 Cal. Rptr. 800, 383 P.2d 152, 10 A.L.R.3d 707]; Wollam v. City of Palm Springs (1963) 59 Cal.2d 276 [29 Cal. Rptr. 1, 379 P.2d 481]; Katzev v. County of Los Angeles (1959) 52 Cal.2d 360 [341 P.2d 310].) In fact the petition filed below incorporates the complaint in one such action as an exhibit and asserts that "the results achieved ... in [petitioner's] criminal action ... are not cognizably different in terms of public benefit [than those] which could or would have been achieved in an affirmative civil action...."[7] In addition petitioner points to several cases such as International Soc. for Krishna, etc. v. Collins (5th Cir.1980) 609 F.2d 151 and Intern. Soc. for Krishna Consc. v. Andersen (8th Cir.1978) 569 F.2d 1027 in which arguably similar results were achieved under the federal Civil Rights Act and attorney's fees were awarded under the aegis of 42 United States Code section 1988.
The short answer to these arguments is that petitioner did not obtain an injunction, a declaratory judgment or relief under the Civil Rights Act. He successfully defended a criminal prosecution at an alleged cost in attorney's fees of $35,000. The fact that petitioner might have reached the same result in some other type of action tells us nothing about the legal costs that would have been incurred in such an action. We simply cannot apply a statute designed to compensate parties for attorney's fees in certain limited situations to cases not within the statute on the theory of what might have been.
The judgment is affirmed.
Stephens, J., and Ashby, J., concurred.
NOTES
[1]  Section 1021.5: "Upon motion, a court may award attorneys' fees to a successful party against one or more opposing parties in any action which has resulted in the enforcement of an important right affecting the public interest if: (a) a significant benefit, whether pecuniary or nonpecuniary, has been conferred on the general public or a large class of persons, (b) the necessity and financial burden of private enforcement are such as to make the award appropriate, and (c) such fees should not in the interest of justice be paid out of the recovery, if any. With respect to actions involving public entities, this section applies to allowances against, but not in favor of, public entities, and no claim shall be required to be filed therefor."
[2]  The question of the criminal defendant's indigency is irrelevant. As a matter of fact, the issue is not likely to arise when the taxpayers foot the bill in the first place.
[3]  Section 1021.5 became effective on January 1, 1978, several months before the Supreme Court's opinion in People v. Fogelson, supra, 21 Cal.3d 158, was filed. Thus, since the Fogelson case was still pending on the effective date of the legislation, the time element is no problem. (Woodland Hills Residents Assn., Inc. v. City Council (1979) 23 Cal.3d 917, 932 [154 Cal. Rptr. 503, 593 P.2d 200].
[4]  All statutory references are, unless otherwise indicated, to the Code of Civil Procedure.
[5]  "Except as attorney's fees are specifically provided for by statute, the measure and mode of compensation of attorneys and counselors at law is left to the agreement, express or implied, of the parties; but parties to actions or proceedings are entitled to costs and disbursements, as hereinafter provided."
[6]  Petitioner makes much of the fact that certain Code of Civil Procedure provisions concerning attorneys have been held to apply to criminal proceedings. The point is of no significance: first, the provisions in question, essentially sections 283 et seq.  do not appear in part 2 "of Civil Actions," but in part 1 "of Courts of Justice;" second, the seminal case which applied the sections to criminal actions appears to have been People v. Bouchard (1957) 49 Cal.2d 438 [317 P.2d 971], which relied heavily on the fact that section 284, as it read at the time, contained a special proviso for civil actions, indicating that the Legislature intended it otherwise to apply to all actions; third, since the Penal Code contains no analogous provisions with respect to the authority, appearance and substitution of attorneys, those found in the Code of Civil Procedure are applicable as a matter of necessity.
[7]  We are not told why the action, filed in 1974, has apparently not been tried to a conclusion.
