The compensation of the city attorney shall be by contract, agreement or resolution of the mayor and council.