After the context has been initiated, we can add the required assets

@param sfEvent $event
772457
public static function listenToContextLoadFactoriesEvent(sfEvent $event)
    {
        /** @param sfContext $context */
        $context = $event->getSubject();

        if (sfContext::getInstance()->getConfiguration()->getEnvironment() == 'dev') {
            $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/bootstrap.css', 'first');
            $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/bootstrap-responsive.css');
            $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/smoothness/jquery-ui-1.10.1.custom.css');
        } else {
            $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/bootstrap.min.css', 'first');
            $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/bootstrap-responsive.min.css');
            $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/smoothness/jquery-ui-1.10.1.custom.min.css');
        }
        $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/jquery-ui-timepicker-addon.css');

        $context->getResponse()->addStylesheet(twAdmin::getProperty('web_dir') . '/css/twadmin.css', 'last');

        if (sfContext::getInstance()->getConfiguration()->getEnvironment() == 'dev') {
            $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/jquery-1.9.1.js');
            $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/bootstrap.js');
            $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/jquery-ui-1.10.1.custom.js');
        } else {
            $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/jquery-1.9.1.min.js');
            $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/bootstrap.min.js');
            $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/jquery-ui-1.10.1.custom.min.js');
        }
        $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/jquery-ui-timepicker-addon.js');
        $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/jquery-ui-datepicker-pl.js');

        $context->getResponse()->addJavascript(twAdmin::getProperty('web_dir') . '/js/twadmin.js', 'last');
    }
881075
public function solveAssets(Event $event)
    {
        $this->solver->setUpdatable(false !== strpos($event->getName(), 'update'));
        $this->solver->solve($event->getComposer(), $event->getIO());
    }
1225281
public static function installThemesAndFiles(Event $event)
    {
        $syncer = DirectorySyncer::fromEvent($event);

        $syncer->sync('files', 'files');
        $syncer->sync('%vendor%/bolt/themes', 'themes', true, ['base-2016', 'base-2018', 'skeleton']);
    }
1139900
public function onCreate(CreateResourceEvent $event)
    {
        $request = $this->container->get('request');
        $form = $this->container->get('form.factory')->create(new FileType(true), new File());
        $form->handleRequest($request);

        if ($form->isValid()) {
            $this->handleFileCreation($form, $event);
        }

        $content = $this->container->get('templating')->render(
            'ClarolineCoreBundle:Resource:createForm.html.twig',
            array(
                'form' => $form->createView(),
                'resourceType' => $event->getResourceType()
            )
        );
        $event->setErrorFormContent($content);
        $event->stopPropagation();
    }
883339
public function after($event = []) {
		$modelDynSchema = ClassRegistry::init('CakeLdap.DynSchema');
		$modelDynSchema->updateSchema($event, $this->connection);
	}
922430
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('detect', $this->detect);
    }
956011
public function onStoryAggregation(AnEvent $event)
    {
        if (!empty($this->_story_aggregation)) {
            $event->aggregations->append(array(
                $this->component => $this->_story_aggregation,
            ));
        }
    }
453775
public function onInstallUpdateOrDump(ScriptEvent $event)
    {
        $this->state->loadSettings();
        $this->state->setDevMode($event->isDevMode());
        $this->mergeFiles($this->state->getIncludes(), false);
        $this->mergeFiles($this->state->getRequires(), true);

        if ($event->getName() === ScriptEvents::PRE_AUTOLOAD_DUMP) {
            $this->state->setDumpAutoloader(true);
            $flags = $event->getFlags();
            if (isset($flags['optimize'])) {
                $this->state->setOptimizeAutoloader($flags['optimize']);
            }
        }
    }
1099117
public function onVichUploaderPreUpload(Event $event)
    {
        $media = $event->getObject();

        $this->checkIfThereIsAName($media);
        $this->checkIfNameEverExistInDatabase($media);
        $this->checkIfFileLocationIsChanging($media);
    }
1309332
public function addEvent(Event $event)
    {
        $expectedSequenceNumber = $this->nextSequenceNumber();
        if ($expectedSequenceNumber !== $event->sequenceNumber()) {
            throw new \RuntimeException('Corrupted sequence number.');
        }

        $this->events[] = $this->applyRegistrationCallbacks($event);
    }
1074832
public function afterHandle($event)
    {
        parent::afterHandle($event);
        
        // reset form_token
        if ($this->request->getMethod() === 'POST') {
            
            if ($this->errorInfo && !$this->errorInfo['errcode'] && $this->options['csrfTokenEnabled'] && $this->options['csrfTokenAutoReset']) {
                $this->resetCsrfToken();
            }
        }
    }
142916
public function addTimeEvent(TimeEvent $event)
    {
        if (!$this->timeEvents) {
            $this->timeEvents = [];
        }
        $this->timeEvents[] = $event;
    }
1317040
public function afterCommit(TransactionEvent $event) {
    if ($event->getPhase() == TransactionEvent::AFTER_COMMIT) {
      $changedOids = $event->getInsertedOids();
      $this->updateCopyOIDs($changedOids);
    }
  }
564525
protected function handle(Event $event): void
    {
        $method = 'apply'.ClassName::short($event);

        if (!method_exists($this, $method)) {
            return;
        }

        $this->$method($event);
    }
970805
public function cleanAssetsAfterScenario(ScenarioEvent $event) {
        foreach(\File::get() as $file) {
            if(file_exists($file->getFullPath())) $file->delete();
        }
    }
34460
public static function postInstall(Event $event)
    {
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';

        static::clearCompiled();
        static::artisanOptimize();
        static::artisanLangJS();
    }
701460
public function addEventToList(Event $event)
    {
        if ($this->_eventList) {
            $this->_eventList->add($event);
        }

        return $this;
    }