RESTful-Drupal / restful

RESTful best practices for Drupal
https://drupal.org/project/restful
419 stars 173 forks source link

why 404 ? #899

Open patrickpeng2091 opened 8 years ago

patrickpeng2091 commented 8 years ago

image

sites/all/modules/restful/modules/restful_example/src/Plugin/resource/node/pen/v1/Pens__1_0.php

http://t8.dd:8084/api/v1.0/pens

patrickpeng2091 commented 8 years ago
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_0.
 */

namespace Drupal\restful_example\Plugin\resource\node\pen\v1;

use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.0",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the articles with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class Pens__1_0 extends ResourceNode implements ResourceInterface {}
e0ipso commented 8 years ago

Did you clear caches after adding the resource?

patrickpeng2091 commented 8 years ago

yes , i clear cache. i modify Code comments can work . but, i don't konw why modify code comments.