Crawler symfony

$crawler = $this->client->request('GET', '/awplans/homepage');
         
$errorTag = $crawler->filter('h1')->each(function($node) {
   return $node->html();
});
        
if (in_array(trim('AW Plany'),$errorTag)) {
  echo 'istnieje';
}
/**
    * @param $crawler - Crawler object  
    * @param $errorTag tag name 
    * @param $tagValue tag value 
    * 
    */
    public function checkTagError(object $crawler, string $tagName,string $tagValue){
                
        $errorTag = $crawler->filter($tagName)->each(function($node) {
            return $node->html();
        });
        
        if (in_array(trim($tagValue),$errorTag)) {
           return true;
        }else{
           return false;
        }
    }

//api bundle

https://github.com/uecode/api-key-bundle

https://packagist.org/packages/ma27/api-key-authentication-bundle

https://medium.com/@_Ma27_/authenticate-users-with-api-keys-using-symfony-and-doctrine-b2270752261a
Komentarze wyłączone