Mechanisms of place cell replay occurring during sharp-wave ripples (SPW-Rs) remain obscure due to the fact that ripples in vitro depend on non-synaptic mechanisms, presumably via axo-axonal gap junctions between pyramidal cells. We suggest a model of in vivo SPW-Rs in which synaptic excitatory post-synaptic potentials (EPSPs) control the axonal spiking of cells in SPW-Rs: ripple activity remains hidden in the network of axonal collaterals (connected by gap junctions) due to conduction failures, unless there is a sufficient dendritic EPSP. The EPSP brings the axonal branching point to threshold, and action potentials from the collateral start to propagate to the soma and to the distal axon. The model coherently explains multiple experimental data on SPW-Rs, both in vitro and in vivo. The mechanism of synaptic gating leads to the following implication: a sequence of pyramidal cells can be replayed at ripple frequency by the superposition of subthreshold dendritic EPSPs and ripple activity in the axonal plexus. Replay is demonstrated in both forward and reverse directions. We discuss several testable predictions. In general, the mechanism of synaptic gating suggests that pyramidal cells under certain conditions can act like a transistor.