clsource

Members
  • Content count

    269
  • Joined

  • Last visited

  • Days Won

    4

clsource last won the day on January 21

clsource had the most liked content!

Community Reputation

421 Excellent

About clsource

  • Rank
    Sr. Member
  • Birthday 10/18/1989

Contact Methods

  • Website URL
    http://ninjas.cl

Profile Information

  • Gender
    Male
  • Location
    Chile

Recent Profile Visitors

5,181 profile views
  1. I recently bought an Android and iOS developer licenses so I can create a stand alone version of the app. That maybe will solve most problems
  2. Hello I made a simple app for reading the main RSS for ProcessWire news. Now you can access ProcessWire Blog, ProcessWire weekly and the Latest Forum Posts in a Single App in your iOS or Android smartphone. Open Source of Course. Made using the http://jasonette.com technology. You can compile your own app if you want. For A Quick Look 1.- Download the Jason App (iOS) https://itunes.apple.com/us/app/jason./id1095557868?mt=8 (Android) https://play.google.com/store/apps/details?id=com.jasonette.jason 2.- Use the Following Url https://raw.githubusercontent.com/NinjasCL/pw-app/master/app.json Source Here https://github.com/NinjasCL/pw-app
  3. I think another way to do it is using <head pw-append="head"> ... </head> I don´t know for sure, . may be it works too.
  4. Interesting, Its similar to https://www.nativescript.org
  5. As a personal experience I would not recommend taking equity only projects. They are too risky.
  6. This is a shorthand function. So its easier to populate tags. /** * Perform a language translation replacing string tags. * * Used as an alternative to sprintf in language string that requires variables. * uses wirePopulateStringTags function for replacing tags. * * The $vars may also be an object, in which case values will be pulled as properties of the object. * * By default, tags are specified in the format: {first_name} where first_name is the name of the * variable to pull from $vars, '{' is the opening tag character, and '}' is the closing tag char. * * The tag parser can also handle subfields and OR tags, if $vars is an object that supports that. * For instance {products.title} is a subfield, and {first_name|title|name} is an OR tag. * * @param string $text Text for translation. * @param WireData|object|array $vars Object or associative array to pull replacement values from. * @param string $context Name of context * @param string $textdomain Textdomain for the text, may be class name, filename, or something made up by you. If omitted, a debug backtrace will attempt to determine automatically. * @param array $options Array of optional changes to default behavior, including: * - tagOpen: The required opening tag character(s), default is '{' * - tagClose: The optional closing tag character(s), default is '}' * - recursive: If replacement value contains tags, populate those too? Default=false. * - removeNullTags: If a tag resolves to a NULL, remove it? If false, tag will remain. Default=true. * - entityEncode: Entity encode the values pulled from $vars? Default=false. * - entityDecode: Entity decode the values pulled from $vars? Default=false. * @return string Translated text or original text if translation not available. * */ function _st($text, $vars, $context = null, $textdomain = null, array $options = array()) { return wirePopulateStringTags(__($text, $textdomain, $context), $vars, $options); } echo _st('There are {count} {items} in the {place}', ['count' => 5, 'items' => 'oranges', 'place' => 'tree']);
  7. Hello, In this tutorial I show how to use the wirePopulateStringTags function in order to improve translatable strings. https://medium.com/@clsource/better-translatable-strings-in-processwire-621e9e6b18ee#.tv2u23j4i Basically it will improve how the strings are shown in the translation administration. echo wirePopulateStringTags( __('There are {count} {items} in the {place}'), ['items' => 'apples', 'count' => 32, 'place' => 'basket'] ); Will render There are 32 apples in the basket And the Translator will see There are {count} {items} in the {place}
  8. Congrats for the Great Work. I wonder how you will distribute the site. Please write an article about your experience so we can learn how to do the same :). How you will manage updates? (specially database related ones) cheers.
  9. Technically my rest helper is just some functions that I used when creating simple Rest backend with ProcessWire. So is nothing too fancy, just what I needed. See the voxgram repo that used the Rest Helper . The magic with PW is that you can integrate it with more sophisticated tools like Symphony components using composer if you want to. May be I should write a simple tutorial using Rest and PW?
  10. May be you can use two approaches. One is creating an API inside PW using special templates and responses. maybe using my Rest Helper https://github.com/NinjasCL/pw-rest heres an example https://github.com/NinjasCL/voxgram The other one is creating an API outside PW using an specialized rest framework and calling PW using composer. http://flightphp.com http://phpsx.org http://phpflow.com/php/restful-api-frameworks-for-php/
  11. Maybe using a forum software with a nice REST API will help you accesing data and performing actions like creating users and log them in. some good modern software are http://flarum.org/docs/api/ http://www.discourse.org
  12. May be starting with something small like a subscription service. Then making things a little more complex like a T shirt shop. Then a more complex one with features similar to woocommerce or something like that. I think is a wonderful idea.
  13. Hello I opensourced my Telegram bot called "Voxgram" https://github.com/NinjasCL/voxgram Now you all have an example of working with the Rest Helper and the Python Telegram Framework (I think the my python code is a mess) but anyway here you go :).
  14. Hello, I will try to respond these questions Questions 1, 2 and 4 could be resolved by using "Transformers" a "Transformer" is simply a class that convert data from one format to another. In this case a transformer that converts PW pages to rest json. And example. If you got a template named video that stores youtube videos and contains the following fields: url, title. You can create a Transformer named like transformers/youtube.php <?php namespace ProcessWire; class YoutubeTransformer { public $source; public __construct(Page $source) { $this->source = $source; } public function toArray() { return [ "url" => $this->source->url, "title" => $this->source->title ]; } public function toJson() { return json_encode($this->toArray()); } } That way you could create a special class that could render specific outputs depending on what do you need. For example {catID}/articleList/{articleID}/galleryList/{galleryID} You could have a specific transformer for categories, articles and gallery items and share the output for each class and join them in the final response. This could also be combined with field specific templates https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/ 3.- For answering this it depends on your architecture and your api requirements. The rule of thumb is think how the developers will use the api and what information they will need. 5.- Well depends on what do you need and feel more confortable, those are just helper methods. there are tons of good code that you could use like https://github.com/marcj/php-rest-service http://symfony.com/doc/current/bundles/FOSRestBundle/index.html http://symfony.com/components/Guard http://symfony.com/components/HttpFoundation http://symfony.com/components/Serializer
  15. Hello, I created a simple telegram bot. What it does? it enables you to save your voice messages and send them later using emojis or keywords in your group chats. Just add @voxgrambot in your group chats and search all the public voice messages available using text or emojis. If you want to create a new voice message just send a private message to the bot with the command /new . If you want more info send the command /help. The bot was made using Python and https://python-telegram-bot.org The backend was made using ProcessWire 3.x and my Rest API helper. http://telegra.ph/Voxgram-Telegram-Bot-12-03