-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lack of documentation #10
Comments
+1 |
@dsfser @akashdeepkanojia This is an example of how I implemented the library in my Laravel project. First of all, use version 2.1 instead of 2.2. The latest seems to not work well with the different ways of registering a shortcode. Once you installed the library through Composer, add the service provider and the facade to your service provider:
facade:
Then you need to create a new service provider. This is where you will register your shortcodes. I named mine
The new file will be placed under Now register your new provider just like you did with the library's:
Then add the code to register your shortcodes. This is an example of how I have mine. I created a protected array with the shortcodes available for my app, then I have a function than spins through this array and registers each one. This structure assumes there is a class called First, the content of
And here, the class that contains the methods to process each shortcode. In this example I only registered two shortcodes:
Now, whenever you need to parse some text containing shortcodes just use the
And pretty much that's it. Hope it helps you implement it. |
i tried to use this example but its showing me Shortcode handler must be callable i have checked all name spaces and paths are correct any help? |
@efcoders Which version of the library are you using? I mention at the beginning of On Friday, May 6, 2016, efcoders [email protected] wrote:
|
i have same issue, i did try install with "2.1.0" as version, but i get a ton of errors with Conclusion dont install laravel framework (many version) and so guess i cant get older version that will install on laravel 5.2? |
@efcoders I had the same error - Try this if you're using Laravel 5: $this->app->bind('shortcode', "App\\ShortCode@{$shortcode}"); |
Hello,
Could you please provide us with some more documentation... for example how to execute the ShortcodeTest . (what values do we need to send to the function testParse...)
and could you give some more explanation in the documentation. where goes the class? where goes the Shortcode::register and where goes the function...
The text was updated successfully, but these errors were encountered: